网站建设资讯

NEWS

网站建设资讯

webpack4学习之问题二

问题
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:
^

目前成都创新互联公司已为1000多家的企业提供了网站建设、域名、网站空间、网站改版维护、企业网站设计、义县网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

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. (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(),//***
],


当前题目:webpack4学习之问题二
网页URL:http://njwzjz.com/article/igdhig.html