Sass does not compile with angular-cli

I am trying to use Sass with angular-cli , but it does not work. I get the following error:

EXCEPTION: Failed to load http://localhost:4200/app/app.component.sass.

I added node-sassto mine package.json, changed styleUrlsto ['app.component.sass'], and also installed "styleExt": "sass"in the file angular-cli.json.

Am I missing something to make it work?

+4
source share
2 answers

Apparently a minor bug in the documentation .

styleUrlsshould not have scssor sassas an extension as well css. Replacing ['app.component.sass']with ['app.component.css']solved the problem.

+4
source

, . .

ng new my_project --style=sass

scss, :

ng new my_project --style=scss
+4

Source: https://habr.com/ru/post/1650372/


All Articles