Taro: 插件运行不起来

Created on 16 Jun 2020  ·  4Comments  ·  Source: NervJS/taro

问题描述


插件配置后, 报错 - configuration.optimization.minimizer[0] misses the property 'apply'.

复现步骤

  1. 运行 编译后 提示: 检测到当前项目没有安装压缩插件 @tarojs/plugin-uglify 或 @tarojs/plugin-terser,打包时将无法压缩 JS 代码,请安装插件(安装其一即可),并且在 plugins 中进行配置!
    参考文档:https://nervjs.github.io/taro/docs/config-detail#plugins
    image
  1. yarn add --dev @tarojs/plugin-terser @tarojs/plugin-uglify

  2. conffig/index.js plugins配置 添加 @tarojs/plugin-uglify 或者 @tarojs/plugin-terser 后, 运行编译,均报错 - configuration.optimization.minimizer[0] misses the property 'apply'.
    image
    image

/**
 * 这段注释后可以贴代码
 * 提供完整可复现的代码和整理好代码格式,有助于我们快速定位问题,节省你我时间
 * 代码提供不全或代码格式混乱的 issues 【有可能会被忽略】
 * 
 * 查看如何插入代码:https://coding.net/help/doc/project/markdown.html#i-5
 */


期望行为


如2.2.3版本一样正常运行

报错信息


image

系统信息


Taro CLI 2.2.8 environment info:
System:
OS: macOS 10.15.4
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
Yarn: 1.17.3 - ~/.nvm/versions/node/v10.16.3/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v10.16.3/bin/npm
npmPackages:
@tarojs/components: 2.2.3 => 2.2.3
@tarojs/components-qa: 2.2.3 => 2.2.3
@tarojs/mini-runner: 2.2.3 => 2.2.3
@tarojs/plugin-babel: 2.2.3 => 2.2.3
@tarojs/plugin-sass: ^2.2.8 => 2.2.8
@tarojs/router: 2.2.3 => 2.2.3
@tarojs/taro: 2.2.3 => 2.2.3
@tarojs/taro-alipay: 2.2.3 => 2.2.3
@tarojs/taro-h5: 2.2.3 => 2.2.3
@tarojs/taro-qq: 2.2.3 => 2.2.3
@tarojs/taro-quickapp: 2.2.3 => 2.2.3
@tarojs/taro-rn: 2.2.3 => 2.2.3
@tarojs/taro-swan: 2.2.3 => 2.2.3
@tarojs/taro-tt: 2.2.3 => 2.2.3
@tarojs/taro-weapp: 2.2.3 => 2.2.3
@tarojs/webpack-runner: 2.2.3 => 2.2.3
eslint-config-taro: 2.2.3 => 2.2.3
eslint-plugin-taro: 2.2.3 => 2.2.3
nerv-devtools: ^1.5.6 => 1.5.6
nervjs: ^1.5.6 => 1.5.6
stylelint-config-taro-rn: 2.2.3 => 2.2.3
stylelint-taro-rn: 2.2.3 => 2.2.3

补充信息

如果您有功能上的建议,可以提到 FeatHub

使用上的问题,欢迎在「Taro 社区」一起交流

question

Most helpful comment

你的项目依赖也需要升级到 2.2.8

All 4 comments

你的项目依赖也需要升级到 2.2.8

问题解决了吗?

大佬怎么解决的?

也出现了这个问题

Was this page helpful?
0 / 5 - 0 ratings