更新的scss版本在vue cli3的項目裏面的配置須要修改參數設置,具體在vue.config.js文件css
sass-loader報錯:
Module build failed (from ./node_modules/_sass-loader@8.0.0@sass-loader/dist/cjs.js):
ValidationError: Invalid options object. Sass Loader has been initialised using an options object that does not match the API schema.vue
注:(D:舊項目webDemo)是咱們本身的項目存放的路徑node
css: { loaderOptions: { sass: { data: `@import "~@/assets/scss/variables.scss";`, //這兒的鍵名改了 }, } }
// 舊 data: `@import "~@/assets/scss/variables.scss";` // 新 prependData: `@import "~@/assets/scss/variables.scss";`