Since installing LESS is easier with NPM or YARN, installing Sass either consistently fails or takes a lot of effort to install. Installation experience is uneven, so unified use of LESS.

The first step is to remove the sass dependencies
yarn remove sass
yarn remove sass-loader
rm -rf .\node_modules\
Copy the code
Step 2 install dependency packages related to less
yarn add less less-loader --dev
Copy the code
Third, check the error source

Note the difference between less and sass. Here are a few

The only difference between Less and Sass is that Less uses @ and Sass uses $Copy the code
Border -#{$left}:10px solid blue; Less uses curly braces to wrap variable names, for example:.theme-#@{theme-name} {... }Copy the code
Sass supports conditional statements, using if{}else{},for{} loops, and so on. Less does not.Copy the code
Step 4: Replace the sass file with less

Note that not all tags need to add lang=”less”, nesting, variables and calculations, Mixin code fragments, loops, etc., and do not change all files to less at once, one by one, otherwise it is difficult to locate errors.

Writing is not good, hope to encourage each other