JavaScript错误仅在uglify mangle为false时发生

sta*_*eth 5 javascript uglifyjs reactjs webpack

此JavaScript错误

超级表达式必须为null或函数,且未定义

仅在webpack mode设置为时抛出production,而我将其缩小到UglifyJsPlugin> uglifyOptions> compress。

有人遇到过这个问题吗?或对哪里看有建议?

Ale*_*rov 0

它帮助了我: https: //github.com/webpack-contrib/uglifyjs-webpack-plugin/issues/264#issuecomment-393727878

new UglifyJsPlugin({
        uglifyOptions: {
          compress: {
            inline: false,
          },
        },
      }),
Run Code Online (Sandbox Code Playgroud)