Skip to content

Commit

Permalink
feat(@angular-devkit/build-angular): favor es2020 main fields
Browse files Browse the repository at this point in the history
APF version 13 will include es2020, with this change we favor es2020 entrypoints.
  • Loading branch information
alan-agius4 authored and filipesilva committed Oct 1, 2021
1 parent ba9c603 commit 22cd9ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Expand Up @@ -54,7 +54,7 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
return {
devtool: false,
resolve: {
mainFields: ['es2015', 'browser', 'module', 'main'],
mainFields: ['es2020', 'es2015', 'browser', 'module', 'main'],
},
output: {
crossOriginLoading,
Expand Down
Expand Up @@ -31,9 +31,9 @@ export function getServerConfig(wco: WebpackConfigOptions): Configuration {
);
}

const config: Configuration = {
return {
resolve: {
mainFields: ['es2015', 'main', 'module'],
mainFields: ['es2020', 'es2015', 'main', 'module'],
},
output: {
libraryTarget: 'commonjs',
Expand All @@ -55,8 +55,6 @@ export function getServerConfig(wco: WebpackConfigOptions): Configuration {
node: false,
externals,
};

return config;
}

function externalizePackages(
Expand Down
Expand Up @@ -54,7 +54,7 @@ export function getTestConfig(
mode: 'development',
target: wco.tsConfig.options.target === ScriptTarget.ES5 ? ['web', 'es5'] : 'web',
resolve: {
mainFields: ['es2015', 'browser', 'module', 'main'],
mainFields: ['es2020', 'es2015', 'browser', 'module', 'main'],
},
devtool: false,
entry: {
Expand Down

0 comments on commit 22cd9ed

Please sign in to comment.