Skip to content

Commit

Permalink
perf(@angular-devkit/build-angular): avoid async downlevel for known …
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
clydin authored and alan-agius4 committed Apr 24, 2021
1 parent 46a5261 commit 54696e7
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -66,7 +66,7 @@ export default custom<AngularCustomOptions>(() => {
// TypeScript files will have already been downlevelled
customOptions.forceES5 = !/\.tsx?$/.test(this.resourcePath);
} else if (esTarget >= ScriptTarget.ES2017) {
customOptions.forceAsyncTransformation = !/[\\\/]fesm2015[\\\/]/.test(this.resourcePath) && source.includes('async');
customOptions.forceAsyncTransformation = !/[\\\/][_f]?esm2015[\\\/]/.test(this.resourcePath) && source.includes('async');
}
shouldProcess ||= customOptions.forceAsyncTransformation || customOptions.forceES5;
}
Expand Down

0 comments on commit 54696e7

Please sign in to comment.