Skip to content

Commit 22cd9ed

Browse files
alan-agius4filipesilva
authored andcommitted
feat(@angular-devkit/build-angular): favor es2020 main fields
APF version 13 will include es2020, with this change we favor es2020 entrypoints.
1 parent ba9c603 commit 22cd9ed

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

packages/angular_devkit/build_angular/src/webpack/configs/browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function getBrowserConfig(wco: WebpackConfigOptions): webpack.Configurati
5454
return {
5555
devtool: false,
5656
resolve: {
57-
mainFields: ['es2015', 'browser', 'module', 'main'],
57+
mainFields: ['es2020', 'es2015', 'browser', 'module', 'main'],
5858
},
5959
output: {
6060
crossOriginLoading,

packages/angular_devkit/build_angular/src/webpack/configs/server.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export function getServerConfig(wco: WebpackConfigOptions): Configuration {
3131
);
3232
}
3333

34-
const config: Configuration = {
34+
return {
3535
resolve: {
36-
mainFields: ['es2015', 'main', 'module'],
36+
mainFields: ['es2020', 'es2015', 'main', 'module'],
3737
},
3838
output: {
3939
libraryTarget: 'commonjs',
@@ -55,8 +55,6 @@ export function getServerConfig(wco: WebpackConfigOptions): Configuration {
5555
node: false,
5656
externals,
5757
};
58-
59-
return config;
6058
}
6159

6260
function externalizePackages(

packages/angular_devkit/build_angular/src/webpack/configs/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function getTestConfig(
5454
mode: 'development',
5555
target: wco.tsConfig.options.target === ScriptTarget.ES5 ? ['web', 'es5'] : 'web',
5656
resolve: {
57-
mainFields: ['es2015', 'browser', 'module', 'main'],
57+
mainFields: ['es2020', 'es2015', 'browser', 'module', 'main'],
5858
},
5959
devtool: false,
6060
entry: {

0 commit comments

Comments
 (0)