vue-cli notes - introduced scss style

 Make a copy for himself, watching video to learn vue, the results of the new version is not webpack.config.js, for a long time

Step a: install dependencies

1  npm install node-sass --save-dev 
2  npm install sass-loader --save-dev
3  npm install style-loader --save-dev
4 npm install sass-resources-loader --save-dev

The first three can be introduced together

npm install node-sass sass-loader style-loader --save-dev

Step 2: Open Build -> utils.js 

Found in the following figure   scss: generateLoaders ( 'sass')

Into the following code, and the import in main.js

scss: generateLoaders('sass').concat({
  loader: 'sass-resources-loader',
  options: {
    resources: path.resolve(__dirname, '你的路径')
  }
}),

Guess you like

Origin www.cnblogs.com/kusaki/p/11332832.html