导航

    Taro 社区

    Taro

    • 注册
    • 登录
    • 搜索
    • 版块
    • 最新
    • 话题
    • 热门
    • 群组
    1. 主页
    2. ysj1997
    Y
    • 资料
    • 关注
    • 粉丝
    • 主题
    • 帖子
    • 最佳
    • 群组

    ysj1997

    @ysj1997

    0
    声望
    1
    帖子
    283
    资料浏览
    0
    粉丝
    0
    关注
    注册时间 最后登录

    ysj1997 关注

    ysj1997 发布的帖子

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

      windows10系统,nodes:v10.22.0;npm:6.14.6; 全局taro:v2.2.8;项目中taro:2.2.8;
      打包编译的时候,报错,提示检测到当前项目没有安装压缩插件 @tarojs/plugin-uglify 或 @tarojs/plugin-terser,打包时将无法压缩 JS 代码,请安装插件(安装其一即可),并且在 plugins 中进行配置!
      参考文档:https://nervjs.github.io/taro/docs/config-detail#plugins
      c9f748a8-7e6f-4bbe-b782-0550f0317210-image.png

      我按照提示添加了@tarojs/plugin-uglify后且配置:

      	plugins: [
      		'@tarojs/plugin-less',
      		'@tarojs/plugin-uglify'
      	],
      

      又出现另外的异常信息:

      (node:10767) UnhandledPromiseRejectionWarning: WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
       - configuration.optimization.minimizer[0] misses the property 'apply'.
         function
         -> The run point of the plugin, required method.
          at webpack (/mnt/d/juliveproject/alipay_julive/node_modules/webpack/lib/webpack.js:31:9)
          at /mnt/d/juliveproject/alipay_julive/node_modules/@tarojs/mini-runner/dist/index.js:37:26
          at Generator.next (<anonymous>)
          at fulfilled (/mnt/d/juliveproject/alipay_julive/node_modules/@tarojs/mini-runner/dist/index.js:5:58)
          at process._tickCallback (internal/process/next_tick.js:68:7)
          at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
          at startup (internal/bootstrap/node.js:283:19)
          at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
      (node:10767) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
      (node:10767) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
      

      尝试了多个taro版本,该问题始终存在。

      发布在 Taro
      Y
      ysj1997