How to configure Sass in vue scaffolding

不言
Release: 2018-06-29 14:49:27
Original
1435 people have browsed it

This article mainly introduces the method of configuring Sass in vue scaffolding. The content is quite good. I will share it with you now and give it as a reference.

The most mature, stable and powerful professional-grade CSS extension language in the world!

Compatible with CSS
Sass is fully compatible with all versions of CSS. We strictly control this so you can seamlessly use any available CSS library.

Rich Features
Sass has more functions and features than any other CSS extension language. The Sass core team works tirelessly to keep it at the forefront.

Mature
Sass has been carefully crafted by its core team for more than 8 years.

INDUSTRY RECOGNITION
Time and time again, the industry has chosen Sass as the CSS extension language of choice.

HUGE COMMUNITY
Several technology companies and hundreds of developers provide support for Sass.

Frameworks
There are countless frameworks built with Sass. Such as Compass, Bourbon, and Susy.

I installed it in vue scaffolding

1 Installation

npm install --save-dev sass-loader //sass-loader依赖于node-sass npm install --save-dev node-sass
Copy after login

2 Configuration: Add configuration in the rules of webpack.base.conf.js in the build folder

{ test: /\.sass$/, loaders: ['style', 'css', 'sass'] } // 不知道为什么我配置完就打包不了, 不配置就是好用的
Copy after login

3 Modify the style tag in APP.vue

##