Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to get .scss instead of .css while generating new angular components

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 ?

like image 774
pooja patil Avatar asked Dec 17 '22 23:12

pooja patil


1 Answers

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
like image 133
Sachin Avatar answered Dec 28 '22 10:12

Sachin