vue安装sass

2020-03-21  本文已影响0人  爱燕燕呀

1.第一步
npm install node-sass --save-dev //安装node-sass
npm install sass-loader --save-dev //安装sass-loader
npm install style-loader --save-dev //安装style-loader
npm install sass-resources-loader
第二步 在webpack.base.conf.js中放入
{
test: /.scss$/,
use: [
'style-loader',
'css-loader',
'postcss-loader',
'sass-loader',
{
loader: 'sass-resources-loader',
options: {
// Provide path to the file with resources
resources: './path/to/resources.scss',

          // Or array of paths
          resources: ['./path/to/vars.scss', './path/to/mixins.scss']
        },
      },
    ],
  },

第三步 运行

上一篇下一篇

猜你喜欢

热点阅读