From 8e7045fbcc9de4024622fdaec46805ee2de18ceb Mon Sep 17 00:00:00 2001 From: ArcherGu <649601376@qq.com> Date: Mon, 19 Jul 2021 08:47:16 +0800 Subject: [PATCH] fix: tsconfig support ESM --- script/rollup.config.ts | 4 +--- tsconfig.json | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/script/rollup.config.ts b/script/rollup.config.ts index 4b47dbf..293b141 100644 --- a/script/rollup.config.ts +++ b/script/rollup.config.ts @@ -20,9 +20,7 @@ export default (env = 'production') => { nodeResolve(), commonjs(), json(), - typescript({ - module: 'ESNext', - }), + typescript(), alias({ entries: [ { find: '@render', replacement: join(__dirname, '../src/render') }, diff --git a/tsconfig.json b/tsconfig.json index 9143c99..c019a80 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "ESNext", - "module": "CommonJS", + "module": "ESNext", "moduleResolution": "node", "importHelpers": true, "jsx": "preserve", @@ -17,5 +17,10 @@ "@root/*": ["./*"] }, "allowSyntheticDefaultImports": true + }, + "ts-node": { + "compilerOptions": { + "module": "CommonJS" + } } }