Skip to content

fix(@angular-devkit/build-angular): revert performance optimization causing regression #14849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,21 @@ export async function generateWebpackConfig(
// For differential loading, we can have several targets
return scriptTargets.map(scriptTarget => {
let buildOptions: NormalizedBrowserBuilderSchema = { ...options };
const supportES2015
= scriptTarget !== ts.ScriptTarget.ES3 && scriptTarget !== ts.ScriptTarget.ES5;

if (differentialLoading) {
// For differential loading, the builder needs to created the index.html by itself
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// For differential loading, the builder needs to created the index.html by itself
// For differential loading, the builder needs to create the index.html by itself

// without using a webpack plugin.
buildOptions = {
...options,
...(
// FIXME: we do create better webpack config composition to achieve the below
// When DL is enabled and supportES2015 is true it means that we are on the second build
// This also means that we don't need to include styles and assets multiple times
supportES2015
? {}
: {
styles: options.extractCss ? [] : options.styles,
assets: [],
}
),
es5BrowserSupport: undefined,
index: '',
esVersionInFileName: true,
scriptTargetOverride: scriptTarget,
};
}

const supportES2015
= scriptTarget !== ts.ScriptTarget.ES3 && scriptTarget !== ts.ScriptTarget.ES5;

const wco: BrowserWebpackConfigOptions = {
root: workspaceRoot,
logger: logger.createChild('webpackConfigOptions'),
Expand Down