10

ng serve compiles my app, but when I'm inspecting the html, the source of the CSS seems to be (style)...(/style). Does anybody knows how to configure sass source map via Angular-CLI ?

3

1 Answer 1

9

When you type ng serve by default angular cli doesn't include sourcemaps files for css files but you can include it by typing this command

ng serve -sm -ec

or

ng serve --sourcemap --extractCss

I use Angular Cli -v 1.0.3, and More information - Angular CLI special cases

Perhaps, its help you.

Sign up to request clarification or add additional context in comments.

5 Comments

on AngularCLI 1.3.0 ng serve -sm -ec works, but ng serve --sourcemap --extractCss doesn't.
Hi, ShinDarth. Very strange. I updated AngularCLI 1.3.2 and all works.
It's not camel case. It's --extract-css
@phip1611 : there are multiple aliases : --extract-css (Boolean) Extract css from global styles onto css files instead of js ones. aliases: -ec, --extractCss
Per comment in stackoverflow.com/a/40224003/3232832, seems as of Dec 2018, NG CLI still cannot properly link to the exact / original SCSS line. However, with the method in this answer, it can at least show you the right line of CSS, which can then be searched for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.