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 ?
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. ...
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With