阅读量:0
更换原因:node-sass经常会出现node版本问题,就很麻烦
卸载项目中的node-sass sass-loader
npm uninstall sass-loader sass
安装dart-sas sass-loader 推荐安装sass@1.26.2 sass-loader@7.3.1
npm install sass-loader@7.3.1 sass@1.26.2
从新配置vue.config.js
// vue.config.js module.exports = { css: { loaderOptions: { sass: { implementation: require('sass'), // This line must in sass option }, }, } }
然后需要全局替换一下/deep/,全局搜索 /deep/
, 将项目里的 /deep/
替换为 ::v-deep
如果使用了stylelint,需要修改配置规则
// stylelint.config.js module.exports = { ... rules: { 'selector-pseudo-element-no-unknown': [ true, { ignorePseudoElements: ['v-deep'], }, ], }, ... };