If you are an Angular developer, you’ve probably noticed that since Angular 2+ they break with almost every release. After wasting many hours in futile attempts to fix them and going through numerous report on Angular GitHub page I finally got to a setup that works.
Fixing dependencies (vendor) sourcemaps
- Open
angular.json
and findtargets->build->configurations
- Add a new configuration after
production
. Name itserve
."configurations": { "production": { ... } "serve": { "extractCss": true }
- Change
serve
task to use the new config by changingtargets->serve->options
"options": { "browserTarget": "PROJECT_NAME:build:serve"
- Open
package.json
and update start scripts"scripts: { ... "start": "ng serve --source-map --vendor-source-map --ssl", }
- Run your project with
npm start
. Inspect your markup. You’ll see dependencies SCSS using the source maps and showing correct paths.