一个webpack入门的大坑
文章目录
学习webpack打包css的时候,遇到了这个错误:
ERROR in ./src/index.css 1:0
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this f
ile. See https://webpack.js.org/concepts#loaders
> .hello{
| color: red;
| }
@ ./src/index.js 1:0-21
明明没有任何的错误,却就是报错了,loader的顺序也没错。
最后发现,是没有加载config。
解答
把package.json的build改为
"build": "webpack --config webpack.config.js",
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论