From 9b3ade579af12225875d6c3039bcf8373272d734 Mon Sep 17 00:00:00 2001 From: ahnpnl Date: Thu, 8 Aug 2024 11:25:26 +0200 Subject: [PATCH] build: build package with `NodeNext` module --- .../compiler/__snapshots__/ts-compiler.spec.ts.snap | 2 +- src/legacy/config/config-set.spec.ts | 2 +- tsconfig.build.json | 1 - tsconfig.json | 8 ++++---- tsconfig.spec.json | 1 - 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/legacy/compiler/__snapshots__/ts-compiler.spec.ts.snap b/src/legacy/compiler/__snapshots__/ts-compiler.spec.ts.snap index 1fc4cd40e5..210583a017 100644 --- a/src/legacy/compiler/__snapshots__/ts-compiler.spec.ts.snap +++ b/src/legacy/compiler/__snapshots__/ts-compiler.spec.ts.snap @@ -20,7 +20,7 @@ exports[`TsCompiler getCompiledOutput isolatedModules true should transpile code { "allowSyntheticDefaultImports": undefined, "esModuleInterop": true, - "module": 1, + "module": 99, } `; diff --git a/src/legacy/config/config-set.spec.ts b/src/legacy/config/config-set.spec.ts index 40ffb4c63c..a15d60604d 100644 --- a/src/legacy/config/config-set.spec.ts +++ b/src/legacy/config/config-set.spec.ts @@ -79,7 +79,7 @@ describe('parsedTsConfig', () => { }) expect(cs.parsedTsConfig.options).toMatchObject({ - module: ts.ModuleKind.CommonJS, + module: ts.ModuleKind.NodeNext, skipLibCheck: true, }) }) diff --git a/tsconfig.build.json b/tsconfig.build.json index a53270c2d4..66b68645ef 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "CommonJS", "target": "ES5", "declaration": true, "stripInternal": true, diff --git a/tsconfig.json b/tsconfig.json index cb2207c75a..d14b390629 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,12 +11,12 @@ "noImplicitReturns": true, "skipLibCheck": true, "esModuleInterop": true, - "moduleResolution": "node", "resolveJsonModule": true, "checkJs": false, - "target": "es2015", - "module": "ESNext", - "lib": ["esnext"], + "target": "ESNext", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext"], "types": ["node", "./globals"] } } diff --git a/tsconfig.spec.json b/tsconfig.spec.json index 6d7b65b691..b36d25c821 100644 --- a/tsconfig.spec.json +++ b/tsconfig.spec.json @@ -1,7 +1,6 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "CommonJS", "target": "ES2015", }, "includes": ["src/**/*.spec.ts"],