webpack安装了css-loader,style-loader,但是在配置项里使用minimize出错
使用的webpack版本是3.10.0 ,去掉了minimize这个选项就没有问题,是版本问题吗,webpack菜鸟,T_T
Asset Size Chunks Chunk Names
bundle.js 17.9 kB 0 [emitted] main
[0] ./src/index.js 91 bytes {0} [built]
[1] ./src/style/base.css 1.2 kB {0} [built]
[2] ./node_modules/_css-loader@2.1.0@css-loader/dist/cjs.js??ref--0-1!./src/style/base.css 374 bytes {0} [built] [failed] [1 error]
[5] ./src/sayHello.js 142 bytes {0} [built]
+ 2 hidden modules
ERROR in ./node_modules/_css-loader@2.1.0@css-loader/dist/cjs.js??ref--0-1!./src/style/base.css
Module build failed: ValidationError: CSS Loader Invalid Options
options should NOT have additional properties
at validateOptions (D:\Code\webpackTest\node_modules\_schema-utils@1.0.0@schema-utils\src\validateOptions.js:32:11)
at Object.loader (D:\Code\webpackTest\node_modules\_css-loader@2.1.0@css-loader\dist\index.js:44:28)
@ ./src/style/base.css 2:14-107
@ ./src/index.js
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! webpack@1.0.0 start: webpack --config webpack.config.js
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the webpack@1.0.0 start 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! C:UsersAdministratorAppDataRoamingnpm-cache_logs2019-01-07T07_47_44_088Z-debug.log
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的 css-loader 的版本是什么?1.0.0 以后 minimize 被取消了
/css-loader/
remove minimize option, use postcss-loader with cssnano or use optimize-cssnano-plugin plugin
版本的问题,minimize这个属性已经被取消了