From 5a0f8571f337914dd734f21ccf8650bbbabcc938 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Fri, 23 Feb 2024 17:11:30 -0500 Subject: [PATCH] fix(js): set moduleResolution to Node10 so it is compatible with CommonJS module --- packages/nx/src/plugins/js/utils/register.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nx/src/plugins/js/utils/register.ts b/packages/nx/src/plugins/js/utils/register.ts index 49094899b5dde2..6377452f9d2393 100644 --- a/packages/nx/src/plugins/js/utils/register.ts +++ b/packages/nx/src/plugins/js/utils/register.ts @@ -112,6 +112,7 @@ export function getTranspiler(compilerOptions: CompilerOptions) { compilerOptions.lib = ['es2021']; compilerOptions.module = ts.ModuleKind.CommonJS; + compilerOptions.moduleResolution = ts.ModuleResolutionKind.Node10; compilerOptions.target = ts.ScriptTarget.ES2021; compilerOptions.inlineSourceMap = true; compilerOptions.skipLibCheck = true;