Skip to content

Commit

Permalink
fix(js): use NodeJs moduleResolution with ts-node to support CommonJS…
Browse files Browse the repository at this point in the history
… module and TS 4.x (#22258)
  • Loading branch information
leosvelperez authored Mar 11, 2024
1 parent c01b566 commit e19f33b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/nx/src/plugins/js/utils/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ export function getTranspiler(compilerOptions: CompilerOptions) {

compilerOptions.lib = ['es2021'];
compilerOptions.module = ts.ModuleKind.CommonJS;
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Node10;
// use NodeJs module resolution until support for TS 4.x is dropped and then
// we can switch to Node10
compilerOptions.moduleResolution = ts.ModuleResolutionKind.NodeJs;
compilerOptions.target = ts.ScriptTarget.ES2021;
compilerOptions.inlineSourceMap = true;
compilerOptions.skipLibCheck = true;
Expand Down

0 comments on commit e19f33b

Please sign in to comment.