Skip to content

Commit 080e51d

Browse files
authored
fix: lower target to support Webpack 4 (#1085)
1 parent 6d3f42e commit 080e51d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

scripts/bundle.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ console.log('Building dist for node (cjs)...');
77

88
// Generate entry-points for cjs compatibility
99
const localeDir = 'locale';
10+
const target = ['ES2019', 'node14.6'];
11+
1012
if (existsSync(localeDir)) {
1113
rmSync(localeDir, { recursive: true, force: true });
1214
}
@@ -33,7 +35,7 @@ buildSync({
3335
// splitting: true, // Doesn't work with cjs
3436
format: 'cjs',
3537
platform: 'node',
36-
target: 'node14',
38+
target,
3739
});
3840

3941
console.log('Building dist for node type=module (esm)...');
@@ -48,6 +50,6 @@ buildSync({
4850
minify: true,
4951
splitting: true,
5052
format: 'esm',
51-
target: 'node14',
53+
target,
5254
outExtension: { '.js': '.mjs' },
5355
});

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2020",
3+
"target": "ES2019",
44
"moduleResolution": "Node",
55
"rootDir": "src",
66
"outDir": "dist",

0 commit comments

Comments
 (0)