fix: tsconfig support ESM

This commit is contained in:
ArcherGu 2021-07-19 08:47:16 +08:00
parent 651a2e6902
commit 8e7045fbcc
2 changed files with 7 additions and 4 deletions

View File

@ -20,9 +20,7 @@ export default (env = 'production') => {
nodeResolve(), nodeResolve(),
commonjs(), commonjs(),
json(), json(),
typescript({ typescript(),
module: 'ESNext',
}),
alias({ alias({
entries: [ entries: [
{ find: '@render', replacement: join(__dirname, '../src/render') }, { find: '@render', replacement: join(__dirname, '../src/render') },

View File

@ -1,7 +1,7 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "ESNext", "target": "ESNext",
"module": "CommonJS", "module": "ESNext",
"moduleResolution": "node", "moduleResolution": "node",
"importHelpers": true, "importHelpers": true,
"jsx": "preserve", "jsx": "preserve",
@ -17,5 +17,10 @@
"@root/*": ["./*"] "@root/*": ["./*"]
}, },
"allowSyntheticDefaultImports": true "allowSyntheticDefaultImports": true
},
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
}
} }
} }