6

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 ?

8
  • you need to add that in .angular-cli.json (root folder of your angular project) and not in angular.json. Commented Apr 14, 2018 at 14:05
  • I am on angular 6. it doesn't have angular-cli.json, i can see only angular.json for configurations. Commented Apr 14, 2018 at 14:14
  • which version of angular-cli are you using? Commented Apr 14, 2018 at 15:02
  • Possible duplicate of Angular-cli from css to scss Commented Apr 14, 2018 at 16:03
  • 1
    I am using 6.0.0 version of angular-cli Commented Apr 15, 2018 at 6:21

1 Answer 1

13

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
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.