Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular-CLI sass Source Map

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 ?

like image 429
Nir Krevner Avatar asked Jan 23 '17 13:01

Nir Krevner


People also ask

How to use Sass with angular CLI?

Using Sass with the Angular CLI 1 Starting an Angular CLI Project with Sass. Normally, when we run ng new my-app, our app will have .css files. ... 2 Converting a Current App to Sass. ... 3 Using Sass Imports. ... 4 Importing Sass Files Into Angular Components. ... 5 Sass Include Paths. ... 6 Using Bootstrap Sass Files. ... 7 Conclusion. ...

How do I get the angular CLI to generate CSS files?

To get the CLI to generate .scss files (or .sass / .less) is an easy matter. You can also set the --style flag with the following: If you’ve already created your Angular CLI app with the default .css files, it will take a bit more work to convert it over.

How do I use a variable from within an angular component?

In the Angular CLI, all components are self-contained and so are their Sass files. In order to use a variable from within a component’s Sass file, you’ll need to import the _variables.scss file.

How do I tell sass to look in a specific folder?

The tilde ( ~) will tell Sass to look in the src/ folder and is a quick shortcut to importing Sass files. In addition to using the ~, we can specify the includePaths configuration when working with the CLI. To tell Sass to look in certain folders, add the config lines to .angular-cli.json like in the app object next to the styles setting.


1 Answers

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.

like image 104
Serhiy Koziuk Avatar answered Sep 24 '22 07:09

Serhiy Koziuk