How to use sass in vue cli webpack (detailed tutorial)

亚连
Release: 2018-06-04 16:54:19
Original
2219 people have browsed it

This article mainly introduces the method of using sass in vue cli webpack. Friends who need it can refer to it

1: Install dependencies

npm install sass-loader node-sass --save-dev
Copy after login

2: Modify style in html

Copy after login

3: Use normal sass syntax

//但是会报错  // 解决方案二 sass 修改为 scss  // 官方解决方案 你需要配置 vue-loader 的选项 { test: /\.vue$/, loader: 'vue-loader', options: { loaders: { scss: 'vue-style-loader!css-loader!sass-loader', //