Skip to content

Commit cba5f6c

Browse files
clydindgp1130
authored andcommitted
fix(@angular-devkit/build-angular): add es2015 exports package condition to browser-esbuild
The `es2015` exports package condition is used by `rxjs` to allow bundlers to use the ES2015-based ESM code instead of the default of ES5-based ESM code. The ES5-based ESM code is larger in size and harder to optimize due to the downlevelled classes. This change results in a ~5Kb size reduction for the main bundle of a new application (129920 -> 124183).
1 parent 0a07e72 commit cba5f6c

File tree

1 file changed

+1
-1
lines changed
  • packages/angular_devkit/build_angular/src/builders/browser-esbuild

1 file changed

+1
-1
lines changed

packages/angular_devkit/build_angular/src/builders/browser-esbuild/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ async function bundleCode(
281281
assetNames: outputNames.media,
282282
target: 'es2020',
283283
mainFields: ['es2020', 'browser', 'module', 'main'],
284-
conditions: ['es2020', 'module'],
284+
conditions: ['es2020', 'es2015', 'module'],
285285
resolveExtensions: ['.ts', '.tsx', '.mjs', '.js'],
286286
logLevel: options.verbose ? 'debug' : 'silent',
287287
metafile: true,

0 commit comments

Comments
 (0)