不要安装node-sass
,安装sass
就可以了,
执行以下脚本:
npm uninstall sass-loader node-sass
npm install sass-loader@8.0.2 sass@1.26.5 --save-dev
package.json如下:
{
"name": "vue3.0-demo-1",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"core-js": "^3.6.5",
"joi": "^17.4.2",
"vue": "^2.6.11"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^7.15.0",
// 这两个是重点:sass、sass-loader
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
学术交流文章,不做为临床依据,特此声明。发布者:Chu,转转请注明出处:https://www.icu.cn/?p=3639