问题
E:\webpack_vue\node_modules\clean-webpack-plugin\dist\clean-webpack-plugin.js:17
throw new Error(`clean-webpack-plugin only accepts an options object. See:
^
Error: clean-webpack-plugin only accepts an options object. See:
https://github.com/johnagan/clean-webpack-plugin#options-and-defaults-optional
at new CleanWebpackPlugin (E:\webpack_vue\node_modules\clean-webpack-plugin\dist\clean-webpack-plugin.js:17:13)
at Object.<anonymous> (E:\webpack_vue\webpack.config.js:28:4)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at WEBPACK_OPTIONS (E:\webpack_vue\node_modules\webpack-cli\bin\convert-argv.js:115:13)
原因:
webpack.config.js文件的配置有问题
解决办法
webpack4关于clean-webpack-plugin的写法为:
plugins:[
new CleanWebpackPlugin(),//***
],
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。