webpack 的 UglifyJSPlugin 一填参数就报错,怎么解决?

正常运行的部分代码:


const UglifyJSPlugin = require('uglifyjs-webpack-plugin');

plugins: [

    new UglifyJSPlugin()

]

但是我一但给UglifyJSPlugin添加配置信息,运行就会报错,比如:


plugins: [

    new UglifyJSPlugin({

        warnings: false

    })

]

无论填什么都报错,不知道哪儿出问题了,求大神指点。

报错信息:


npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! webpack02@1.0.0 pack: `webpack`

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the webpack02@1.0.0 pack script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

npm ERR!     e:\tools\Roaming\npm-cache\_logs\2017-11-21T03_11_35_179Z-debug.log


四季花海
浏览 1723回答 2
2回答

墨色风雨

npm uninstall webpack --save-devnpm install webpack@3.6.0 --save-dev我是使用3.6的版本解决了
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript