Skip to content

Commit 63a2dbb

Browse files
committed
perf(@angular-devkit/build-angular): skip FESM2015 from async transformation
Skip `async` transformation when the path matches a FESM2015 entrypoint. Ng-packagr doesn't allow changing the script target for entry-points which makes this possible https://github.com/ng-packagr/ng-packagr/blob/master/src/lib/ng-package/entry-point/compile-ngc.transform.ts#L48 This is important to reduce greatly the cold build performance overhead when targeting ES2017+
1 parent 9714aa9 commit 63a2dbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/angular_devkit/build_angular/src/babel/webpack-loader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export default custom<AngularCustomOptions>(() => {
9898
// TypeScript files will have already been downlevelled
9999
customOptions.forceES5 = !/\.tsx?$/.test(this.resourcePath);
100100
} else if (esTarget >= ScriptTarget.ES2017) {
101-
customOptions.forceAsyncTransformation = source.includes('async');
101+
customOptions.forceAsyncTransformation = !/[\\\/]fesm2015[\\\/]/.test(this.resourcePath) && source.includes('async');
102102
}
103103
shouldProcess ||= customOptions.forceAsyncTransformation || customOptions.forceES5;
104104
}

0 commit comments

Comments
 (0)