It is configured according to the online tutorial, but it still reports errors. The error information is as follows:
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
width: $sideBarWidth !important;
^
Undefined variable: "$sideBarWidth".
Baidu has a problem with the version of SASS loader
// in sass version 9, additionaldata is used, in sass version 8, prependdata is used, and in other versions, data
my version is 7.1.0, so finally changing the key name to data solves the problem
in vue.config.js, the configuration is as follows:
module.exports = {
...
css: {
// extract: true // Whether to use the css separation plugin ExtractTextPlugin (open skeleton screen must be this configuration)
// css presetter configuration item
// use additionalData in sass version 9 use prependData in version 8, other versions, use data
// semicolon here; required
loaderOptions: {
sass: {
data: '@import "./src/styles/variables.scss";'
}
},
},
...
},
Note: semicolon after the configuration file path; Media query expression must begin with ‘(‘
Read More:
- How to Solve @Vue/cli3.X Using less Error
- How to Solve Vue cli syntax Close Error
- Vue Use scss Error: this.getOptions is not a function [How to Solve]
- How to Solve Vue add element Install Error
- Vue installation @ Vue/cli error: npmerr gyp err
- How to Solve VUE Error: Mixed spaces and tabs
- How to Solve Vue3 using deep syntax Error
- How to Solve Vue loading 3D model Error
- How to Solve Vscode save Vue file eslint error
- How to Solve Vue3 Import lodash error
- Vue: How to Solve Eslint error
- How to Solve Vue3 jweixin-module Error
- [error] IDE service port disabled. To use CLI Call, please enter y to confirm enabling CLI capabilit
- [Solved] Vue3 Error: Cant find variable: GlobalThis
- How to Solve VUE Error: Avoid mutating a prop directly since the value will be overwritten …
- How to Solve Vue editor bridge error
- VUE: How to Solve NPM Always Install Error
- How to Solve “Vue is not defined” Error
- How to Solve Vue project Startup Error (Node Upgrade issue)
- [Solved] Vue cli installation Fastclick Error