In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Xiaobian to share with you node16+ how to configure the corresponding sass environment, I hope you have something to gain after reading this article, let's discuss it together!
The new colleague ran my previous project, but he couldn't run it no matter how hard he tried. He kept reporting node-sass mistakes. He didn't solve it after a long time. It was too torturous.
found
My colleague's version of node is different from my local version of node, he is 16+ and I am 14+, which is too torturous. After querying the data, we found that the sass corresponding to each version of node is different.
1. Node-sass is used accurately
node-sass correspondence table
node 16 correct version posture
package.json
"node-sass": "^6.0.1","sass-loader": "^10.0.1",
vue.configl.js global variable also needs to be modified
loaderOptions: { sass: { //Both of the following are possible additionalData: `@import "~@a/scss/entrance.scss";`//sass-laoder Version 10+ //prependData: `@import "./ src/assets/scss/entrance.scss";`// sass-loader 8+ version},
node-sass and sass-loader matching
sass-loader 4.1.1,node-sass 4.3.0sass-loader 7.0.3,node-sass 4.7.2sass-loader 7.3.1,node-sass 4.7.2sass-loader 7.3.1,node-sass 4.14.1
Recommended node management tool nvm
This way we can switch node versions back and forth freely and adapt to different project environments.
2. Dart-Sass is recommended
The mainstream direction in the future is dart-sass
use
1. Unload node-sass
2. Installation
"sass": "1.32","sass-loader": "^10.0.5",
3, encountered warning problems, refer to issues, downgrade can be achieved
After reading this article, I believe you have a certain understanding of "node16+ how to configure the corresponding sass environment". If you want to know more about it, please pay attention to the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.