5

I want .scss files to get generated when i create new components through angular cli, but i am get .css files. Tried adding defaults

"defaults": {   
     "styleExt": "scss", 
} 

in angular.json but it did not work. I am working on latest version i.e Angular 6. Anyone knows how to get this ?

pooja patil
  • 91
  • 1
  • 9

1 Answers1

12

It's not like previous versions,

"defaults": {   
     "styleExt": "scss", 
} 

You need to replace the above lines with below code.

"schematics": {
    "@schematics/angular:component": {
      "style": "scss"
    }
  }

You can easily set the style while creating the project with below code.

ng new project_name --style=scss
Christian Davén
  • 16,713
  • 12
  • 64
  • 77
Sachin
  • 2,627
  • 1
  • 19
  • 35