Last active
July 2, 2024 01:54
-
-
Save spasma/55125865bd42a0db6f254c2c57a2ae4f to your computer and use it in GitHub Desktop.
Revisions
-
spasma revised this gist
Dec 17, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ find . -name "*.css" -exec bash -c 'mv "$1" "${1%.css}".scss' - '{}' \; cd .. # change angular cli config in angular.json sed -i -e 's/styles.css/styles.scss/g' angular.json # Change all ts-files (change .css to .scss) in @Module styleUrls find ./src -name "*.ts" -exec sed -i -e 's/\(.*styleUrls.*\)\.css\(.*\)/\1\.scss\2/g' {} + -
spasma created this gist
Dec 17, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #### Please Backup your project first!!!!!!!! # run this in your project root folder # rename all your src files cd src find . -name "*.css" -exec bash -c 'mv "$1" "${1%.css}".scss' - '{}' \; cd .. # change angular cli config in angular.json sed -i -e 's/styles.css/styles.scss/g' .angular.json # Change all ts-files (change .css to .scss) in @Module styleUrls find ./src -name "*.ts" -exec sed -i -e 's/\(.*styleUrls.*\)\.css\(.*\)/\1\.scss\2/g' {} + find ./src -name "*.ts-e" -exec bash -c 'rm "$1"' - '{}' \; # Angular <6.1 (running on 8 doesn't break anything) ng set defaults.styleExt scss # Angular 6+ version of the above one ng config schematics.@schematics/angular:component.styleext scss # Add node-sass npm module npm install node-sass --save-dev # Everything should work now!