close
New projects
For new projects we can set the options --style=sass
or --style=scss
according to the desired flavor SASS/SCSS
-
Use SASS syntax
ng new project --style=sass
-
Use SCSS syntax
ng new project --style=scss
then install node-sass
,
npm install node-sass --save-dev
Updating existing projects
To make angular-cli
to compile sass files with node-sass
, I had to run,
npm install node-sass --save-dev
which installs node-sass
. Then
-
for SASS syntax
ng set defaults.styleExt sass
-
for SCSS syntax
ng set defaults.styleExt scss
to set the default styleExt to sass
(or)
change styleExt
to sass
or scss
for desired syntax in .angular-cli.json
,
-
for SASS syntax
"defaults": { "styleExt": "sass", }
-
for SCSS syntax
"defaults": { "styleExt": "scss", }
全站熱搜