vue引入sass
sass
vue-cli 安装sass
npm install -D sass-loader@10.1.1 sass
安装错误
如果你使用
npm install -D sass-loader sass
默认安装了高版本的sass-loader,可能会出现下面的错误:
TypeError: this.getOptions is not a function
Similar to what @KostDM said, in my case it seems like sass-loader@11.0.0 doesn't work with vue@2.6.12.
I installed sass-loader@10.1.1 and it worked like a charm again.
vue3 也不能使用更高版本的sass-loader.
解决方法只要安装sass-loader@10.1.1就可以了。
转载自:https://segmentfault.com/a/1190000041963545