-
-
Notifications
You must be signed in to change notification settings - Fork 544
Closed
techsysvbo/kubernetes-tutorials
#3Labels
Description
ESM loader uses our current ignored() implementation to determine if it should transform a file. This only excludes the .js and .jsx file extensions as needed. This worked fine with our CommonJS loader, because we knew we were only registered for the .ts, .tsx, and maybe .js and .jsx extensions.
The ESM loader is different, so it's asking ignore() about .mjs files. (maybe other extensions too?)
We need to update the ignored() implementation to include rather than exclude file extensions so that we only transform the same files that tsc can transform.
Lines 837 to 845 in ce7c323
| const ignored = (fileName: string) => { | |
| if (!active) return true | |
| const relname = relative(cwd, fileName) | |
| if (!config.options.allowJs) { | |
| const ext = extname(fileName) | |
| if (ext === '.js' || ext === '.jsx') return true | |
| } | |
| return !isScoped(relname) || shouldIgnore(relname) | |
| } |