scenario
- Vue-cli create project,
- npm i
- npm run serve
- Sass is used in the project
- Sass – loader && (sass | | node – sass) version of matching error
Cause The loader version combination is incorrect
There are two processing schemes for sASS compilation of Loader:
- Node – sass and sass – loader
- Sass and sass – loader
The solution
Sass compiles the loader version correctly. After practice, the sASS compiles the Loader version properly:
Less compiles the combined version
Uniapp project special: does not support the lower version of sass-Loader, [email protected] + version
Therefore, the combination is as follows:
Pay attention to
-
sass-loader@7.+ version does not support style penetration /deep/, change to earlier version [email protected]
-
Or ::v-deep instead of /deep/
== Remarks == The above version combination does not report errors, you can also practice to explore the expansion of the upper and lower versions
Style penetrates tips
- Styles can be written in three ways:
- /deep/
- ::v-deep
- Three right arrows >>>
- Pay attention to the point
- sass-loader@7.+ does not support /deep/. Change to earlier version [email protected]
- Sass/sass-loader does not recognize >>> writing
- /deep/ and ::v-deep are nicknames for >>>
- Stylus style penetration >>>
- It is said that :: V-deep is more efficient than /deep/
==end==