From 080e51d19afc5c426b804f6afbd44333bbd0d1c9 Mon Sep 17 00:00:00 2001 From: Jess Date: Sat, 18 Jun 2022 10:11:19 -0400 Subject: [PATCH] fix: lower target to support Webpack 4 (#1085) --- scripts/bundle.ts | 6 ++++-- tsconfig.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) 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",