Search code examples
vue.jswebpackvuejs2vue-componentsass-loader

SCSS works without SASS-loader in Vue JS


This is something weird that I am unable to figure out. I did not install sass-loader from Vue, nor did I configure webpack for SCSS, but it still works fine when I use

<style lang='scss'>....some SCSS code here....</style>

inside my Vue component.


Solution

  • After some research: vue init is deprecated syntax for Vue-CLI 2.x that used to clone templates into your new project folder. One of these templates is the webpack-simple which you defined in your command.

    In the webpack.config.js for this template, you can see that sass-loader is preconfigured.


    Since Vue-CLI 3.0 and up, the command used to generate a new app is vue create.