We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
微信小程序
小程序基础库: 2.7.3 使用框架: React
路径:项目根目录/plugin/plugin-demo/index.js
// index.js export default ctx => { // plugin 主体 ctx.onBuildStart(() => { console.log('编译开始!') }) ctx.onBuildFinish(() => { console.log('编译结束!') }) } // config/index.js const config = { // ... plugins: [ '@tarojs/plugin-sass', '@tarojs/plugin-uglify', '/plugin/plugin-demo' ] }
编译成功
Cannot find module 'plugin/plugin-demo' from ...
Taro CLI 2.2.11 environment info: System: OS: macOS 10.14.6 Shell: 5.3 - /bin/zsh Binaries: Node: 14.4.0 - /usr/local/bin/node npm: 6.14.4 - /usr/local/bin/npm npmPackages: @tarojs/components: 2.2.11 => 2.2.11 @tarojs/components-qa: 2.2.11 => 2.2.11 @tarojs/mini-runner: 2.2.11 => 2.2.11 @tarojs/plugin-sass: 2.2.11 => 2.2.11 @tarojs/plugin-uglify: 2.2.11 => 2.2.11 @tarojs/router: 2.2.11 => 2.2.11 @tarojs/taro: 2.2.11 => 2.2.11 @tarojs/taro-alipay: 2.2.11 => 2.2.11 @tarojs/taro-h5: 2.2.11 => 2.2.11 @tarojs/taro-qq: 2.2.11 => 2.2.11 @tarojs/taro-quickapp: 2.2.11 => 2.2.11 @tarojs/taro-rn: 2.2.11 => 2.2.11 @tarojs/taro-swan: 2.2.11 => 2.2.11 @tarojs/taro-tt: 2.2.11 => 2.2.11 @tarojs/taro-weapp: 2.2.11 => 2.2.11 @tarojs/webpack-runner: 2.2.11 => 2.2.11 eslint-config-taro: 2.2.11 => 2.2.11 eslint-plugin-taro: 2.2.11 => 2.2.11 nerv-devtools: ^1.5.7 => 1.5.7 nervjs: ^1.5.7 => 1.5.7 stylelint-config-taro-rn: 2.2.11 => 2.2.11 stylelint-taro-rn: 2.2.11 => 2.2.11 taro-ui: ^2.3.2 => 2.3.2
The text was updated successfully, but these errors were encountered:
@luckyadam 请问这个插件路径有什么问题吗?按文档写的绝对路径啊
Sorry, something went wrong.
你解决了吗? 我也遇到这个问题了
const path = require("path"); 然后 path.resolve(/plugin/plugin-demo), 或者 path.resolve(/plugin/plugin-demo/index.js),
试试
这种路径试试/Users/xxxx/myApp/plugins/test
No branches or pull requests
相关平台
微信小程序
小程序基础库: 2.7.3
使用框架: React
复现步骤
路径:项目根目录/plugin/plugin-demo/index.js
期望结果
编译成功
实际结果
Cannot find module 'plugin/plugin-demo' from ...
环境信息
The text was updated successfully, but these errors were encountered: