From 080e51d19afc5c426b804f6afbd44333bbd0d1c9 Mon Sep 17 00:00:00 2001 From: Jess Date: Sat, 18 Jun 2022 10:11:19 -0400 Subject: fix: lower target to support Webpack 4 (#1085) --- scripts/bundle.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/bundle.ts b/scripts/bundle.ts index 46bcf590..3b72941a 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' }, }); -- cgit v1.2.3