How do I enable sourcemaps for CSS files in my Angular 6 application?
I'm defining my styles source code in SCSS files, which are later compiled to CSS by Angular CLI. However, I can't see the original source code in the browser during styles debugging. All styles are pointing to the <style>...</style>
blocks.
I want to be able to see the references to original SCSS files when debugging the compiled code.
What options do I need to set in angular.json
file?
I've tried to use --source-map
CLI argument for ng serve
command, but it looks like it's not affecting anything. Sourcemap files are emitted in both cases according to webpack compilation log.
build>configurations>serve
entire node had to be added. Also you can just look at what theserve>builder>options>browserTarget
is using and add the"extractCss": true,
to that node under builder instead of using "serve" – Zubkoff