diff --git a/scripts/bundle.ts b/scripts/bundle.ts index 46bcf590f99..3b72941a828 100644 --- a/scripts/bundle.ts +++ b/scripts/bundle.ts @@ -7,6 +7,8 @@ console.log('Building dist for node (cjs)...'); // Generate entry-points for cjs compatibility const localeDir = 'locale'; +const target = ['ES2019', 'node14.6']; + if (existsSync(localeDir)) { rmSync(localeDir, { recursive: true, force: true }); } @@ -33,7 +35,7 @@ buildSync({ // splitting: true, // Doesn't work with cjs format: 'cjs', platform: 'node', - target: 'node14', + target, }); console.log('Building dist for node type=module (esm)...'); @@ -48,6 +50,6 @@ buildSync({ minify: true, splitting: true, format: 'esm', - target: 'node14', + target, outExtension: { '.js': '.mjs' }, }); diff --git a/tsconfig.json b/tsconfig.json index 99a90a33f91..1944ff18532 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES2020", + "target": "ES2019", "moduleResolution": "Node", "rootDir": "src", "outDir": "dist",