Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular CLI: generate SASS project from existing project

I've began working on an Angular CLI generated project and realized I forgot the --style=sassflag. Is there any way to convert my project to enable SASS with the Angular CLI?

like image 871
t3__rry Avatar asked Jan 02 '17 14:01

t3__rry


1 Answers

In Angular 6+ if you are getting console warning after doing ng config defaults.styleExt = scss such as below is because of single dashes are not supported anymore

Schema validation failed with the following errors:
 Data path "" should NOT have additional properties(defaults).

You can run below command to change schematics

ng config schematics.@schematics/angular:component.styleext scss

You need to do two manual changes

  • Rename .css file to .scss in the root folder
  • Update angular.json file with "styles": ["src/styles.scss"],
like image 154
Anjum.... Avatar answered Oct 04 '22 21:10

Anjum....