Skip to content

Commit b3b4546

Browse files
filipesilvamgechev
authored andcommitted
fix(@angular-devkit/build-angular): never use component css sourcemap when optimizations are on. (#15238)
It will just increase bundle size without offering good debug experience.
1 parent d1b0448 commit b3b4546

File tree

1 file changed

+7
-1
lines changed
  • packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs

1 file changed

+7
-1
lines changed

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/styles.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,13 @@ export function getStylesConfig(wco: WebpackConfigOptions) {
193193
options: {
194194
ident: 'embedded',
195195
plugins: postcssPluginCreator,
196-
sourceMap: cssSourceMap && !buildOptions.sourceMap.hidden ? 'inline' : false,
196+
sourceMap: cssSourceMap
197+
// Never use component css sourcemap when style optimizations are on.
198+
// It will just increase bundle size without offering good debug experience.
199+
&& !buildOptions.optimization.styles
200+
// Inline all sourcemap types except hidden ones, which are the same as no sourcemaps
201+
// for component css.
202+
&& !buildOptions.sourceMap.hidden ? 'inline' : false,
197203
},
198204
},
199205
...(use as webpack.Loader[]),

0 commit comments

Comments
 (0)