From 4d32ede36d6a0b5325dd8b8da8fe900fba11dcae Mon Sep 17 00:00:00 2001 From: Jessica Sachs Date: Fri, 17 Jun 2022 12:23:41 -0400 Subject: [PATCH 1/3] fix: lower target to support Webpack 4 (close #1073) --- scripts/bundle.ts | 4 ++-- tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/bundle.ts b/scripts/bundle.ts index 46bcf590f99..6d279d81e50 100644 --- a/scripts/bundle.ts +++ b/scripts/bundle.ts @@ -33,7 +33,7 @@ buildSync({ // splitting: true, // Doesn't work with cjs format: 'cjs', platform: 'node', - target: 'node14', + target: 'es2019', }); console.log('Building dist for node type=module (esm)...'); @@ -48,6 +48,6 @@ buildSync({ minify: true, splitting: true, format: 'esm', - target: 'node14', + target: 'es2019', outExtension: { '.js': '.mjs' }, }); diff --git a/tsconfig.json b/tsconfig.json index 99a90a33f91..a6131555686 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES2020", + "target": "es2019", "moduleResolution": "Node", "rootDir": "src", "outDir": "dist", From b95c6908eb7f4395b1d6de6c08e044b22e502292 Mon Sep 17 00:00:00 2001 From: Jessica Sachs Date: Sat, 18 Jun 2022 09:43:01 -0400 Subject: [PATCH 2/3] fix: adding 14.6 explicitly to the targets array for esbuild. --- .github/workflows/ci.yml | 2 +- scripts/bundle.ts | 6 ++++-- tsconfig.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1691afe74f..22e919d5158 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node_version: [14, 16, 18] + node_version: [14.6, 16, 18] include: - os: macos-latest node_version: 16 diff --git a/scripts/bundle.ts b/scripts/bundle.ts index 6d279d81e50..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: 'es2019', + target, }); console.log('Building dist for node type=module (esm)...'); @@ -48,6 +50,6 @@ buildSync({ minify: true, splitting: true, format: 'esm', - target: 'es2019', + target, outExtension: { '.js': '.mjs' }, }); diff --git a/tsconfig.json b/tsconfig.json index a6131555686..1944ff18532 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es2019", + "target": "ES2019", "moduleResolution": "Node", "rootDir": "src", "outDir": "dist", From ef479637347fdd63070862b19ddf71a9de075138 Mon Sep 17 00:00:00 2001 From: Jessica Sachs Date: Sat, 18 Jun 2022 09:54:23 -0400 Subject: [PATCH 3/3] fix: still building in 14.x and only setting compilation target to 14.6 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22e919d5158..a1691afe74f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - node_version: [14.6, 16, 18] + node_version: [14, 16, 18] include: - os: macos-latest node_version: 16