Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ export default custom<AngularCustomOptions>(() => {
if (esTarget !== undefined) {
if (esTarget < ScriptTarget.ES2015) {
customOptions.forceES5 = true;
} else if (esTarget >= ScriptTarget.ES2017) {
} else if (esTarget >= ScriptTarget.ES2017 || /\.[cm]?js$/.test(this.resourcePath)) {
// Application code (TS files) will only contain native async if target is ES2017+.
// However, third-party libraries can regardless of the target option.
// APF packages with code in [f]esm2015 directories is downlevelled to ES2015 and
// will not have native async.
customOptions.forceAsyncTransformation =
!/[\\\/][_f]?esm2015[\\\/]/.test(this.resourcePath) && source.includes('async');
}
Expand Down