pooja patil
pooja patil

Reputation: 101

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 ?

Upvotes: 6

Views: 4159

Answers (1)

Sachin
Sachin

Reputation: 2765

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

Upvotes: 13

Related Questions