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
  • Loading branch information
leosvelperez committed Mar 11, 2024
1 parent c01b566 commit 9b2873d
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 9b2873d

Please sign in to comment.