学习webpack的官方指南,出现了这个错误:
ERROR in ./src/style.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 file. See https://webpack.js.org/concepts#loaders
> .hello {
| color: red;
| }
@ ./src/index.js 2:0-21
如果你是跟着官方教程一步一步敲得,还出现了这个问题,那就是把单词拼错了,把 exports 拼写成 export 了,改正过来就能 npm run build 打包编译成功了。
老手犯这个错误的可能比较多,写ES6 写多了。
说到单词拼写错误,真的是比较让人头疼的问题,之前我还单门写了一篇单词拼写错误解决方案。可以看一看,我实际使用下来真的代码感觉拼写错误几乎能够接避免百分之九十以上。