Skip to content

Commit 4910a7e

Browse files
committed
fix(@angular-devkit/build-angular): revert performance optimization causing regression
This reverts commit 10200f1. The optimization was causing regression because we didn't cherry-pick angular#14419 in patch.
1 parent cb296b8 commit 4910a7e

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

packages/angular_devkit/build_angular/src/utils/webpack-browser-config.ts

+5-14
Original file line numberDiff line numberDiff line change
@@ -68,30 +68,21 @@ export async function generateWebpackConfig(
6868
// For differential loading, we can have several targets
6969
return scriptTargets.map(scriptTarget => {
7070
let buildOptions: NormalizedBrowserBuilderSchema = { ...options };
71-
const supportES2015
72-
= scriptTarget !== ts.ScriptTarget.ES3 && scriptTarget !== ts.ScriptTarget.ES5;
73-
7471
if (differentialLoading) {
72+
// For differential loading, the builder needs to created the index.html by itself
73+
// without using a webpack plugin.
7574
buildOptions = {
7675
...options,
77-
...(
78-
// FIXME: we do create better webpack config composition to achieve the below
79-
// When DL is enabled and supportES2015 is true it means that we are on the second build
80-
// This also means that we don't need to include styles and assets multiple times
81-
supportES2015
82-
? {}
83-
: {
84-
styles: options.extractCss ? [] : options.styles,
85-
assets: [],
86-
}
87-
),
8876
es5BrowserSupport: undefined,
8977
index: '',
9078
esVersionInFileName: true,
9179
scriptTargetOverride: scriptTarget,
9280
};
9381
}
9482

83+
const supportES2015
84+
= scriptTarget !== ts.ScriptTarget.ES3 && scriptTarget !== ts.ScriptTarget.ES5;
85+
9586
const wco: BrowserWebpackConfigOptions = {
9687
root: workspaceRoot,
9788
logger: logger.createChild('webpackConfigOptions'),

0 commit comments

Comments
 (0)