Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vue CLI: set default style language to scss

Tags:

vue.js

vue-cli

Is there an option in Vue CLI (like in Angular CLI) to set the default language used in component styles to "scss"?

Must I set lang="scss" in all my style markups by myself?

like image 504
szarancza ze spizu Avatar asked Nov 07 '22 04:11

szarancza ze spizu


1 Answers

You can try to setup your loaders in webpack config in a correct order.

And in there isn't a specific item called scss it is sass here which will handle .scss

module: {
  loaders: [{
    test: /\.js$/,
    loader: 'babel',
    exclude: /node_modules/
  }, {
    test: /\.vue$/,
    loader: 'vue'
  }, {
    test: /\.s[a|c]ss$/,
    loader: 'style!css!sass'
  }]
},
vue: {
  loaders: {
    scss: 'style!css!sass'
  }
}
like image 119
cris Avatar answered Nov 15 '22 12:11

cris