Configuration method of using sass in vue project_vue.js

php中世界最好的语言
Release: 2018-05-09 13:45:54
Original
3271 people have browsed it

This time I will give you a detailed explanation of the steps to configure vue using sass. What are theprecautions for vue using sass configuration?. The following is a practical case, let's take a look.

1. Create a new project based on webpack template

$ vue init webpack myvue
Copy after login

2. In the current directory,InstallDependencies

$ cd myvue $ npm install
Copy after login

3. Install sass Dependent package

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

4. Add configuration in the rules of webpack.base.conf.js in the build folder

{ test: /\.sass$/, loaders: ['style', 'css', 'scss'] }
Copy after login

as shown below:

5. Modify the style tag in APP.vue