Skip to content

Commit 54696e7

Browse files
clydinalan-agius4
authored andcommitted
perf(@angular-devkit/build-angular): avoid async downlevel for known ES2015 code
Library code inside fesm2015/esm2015/_esm2015 directories has been downlevelled to ES2015 which will not have native async/await. As a result, code from those directories can be skipped from the additional checks as well as the downlevel processing. RxJS uses the `_esm2015` directory naming convention. (cherry picked from commit 767f0ff)
1 parent 46a5261 commit 54696e7

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
@@ -66,7 +66,7 @@ export default custom<AngularCustomOptions>(() => {
6666
// TypeScript files will have already been downlevelled
6767
customOptions.forceES5 = !/\.tsx?$/.test(this.resourcePath);
6868
} else if (esTarget >= ScriptTarget.ES2017) {
69-
customOptions.forceAsyncTransformation = !/[\\\/]fesm2015[\\\/]/.test(this.resourcePath) && source.includes('async');
69+
customOptions.forceAsyncTransformation = !/[\\\/][_f]?esm2015[\\\/]/.test(this.resourcePath) && source.includes('async');
7070
}
7171
shouldProcess ||= customOptions.forceAsyncTransformation || customOptions.forceES5;
7272
}

0 commit comments

Comments
 (0)