Reputation:
I have an Angular 4 project created using the Angular CLI.
I know that when you are using the Angular CLI you can create a project that uses SASS like this:
ng new ProjectName --style=sass
My question is: "Can I use the Angular CLI to install SASS after a project has been already created without it?"
Upvotes: 1
Views: 1483
Reputation: 21698
if you want to do it manually you can also do that by changing the angular cli configuration file
in your .angular-cli.json change style css to scss
"defaults": {
"styleExt": "scss"
}
And then install node-scss
to compile your scss files
npm install node-sass --save-dev
Upvotes: 0
Reputation: 2855
Using Angular CLI - just do
ng set defaults.styleExt scss
All new components will use SCSS not CSS. Though if you just want to start using SCSS - changing existing .css files to .scss files will work. The relevant compiler is already present batteries included
Upvotes: 0
Reputation: 632
You can set it to style with ng set
after installing node-sass
npm install node-sass --save-dev
ng set defaults.styleExt scss
Taken from here: Angular CLI SASS options
Upvotes: 1