vue-cli (webpack) 意外字符

vue-cli (webpack) unexpected character

我遇到 sass 文件的问题(当我删除 sass 文件时,所有构建过程都成功通过),错误是:

Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleParseError: Module parse failed: Unexpected character '�' (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

据我所知,我需要向我的 vue.config.js 添加一些加载程序,但我不明白我需要添加什么加载程序?从错误中,不清楚是哪个 file/line 导致了问题(我有几个 scss 文件)

安装sass加载器和节点-sass

运行npm install -D sass-loader node-sass。你可以看到更多here