Skip to content

Commit

Permalink
fix: lower target to support Webpack 4 (#1085)
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaSachs committed Jun 18, 2022
1 parent 6d3f42e commit 080e51d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scripts/bundle.ts
Expand Up @@ -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 });
}
Expand All @@ -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)...');
Expand All @@ -48,6 +50,6 @@ buildSync({
minify: true,
splitting: true,
format: 'esm',
target: 'node14',
target,
outExtension: { '.js': '.mjs' },
});
2 changes: 1 addition & 1 deletion tsconfig.json
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2020",
"target": "ES2019",
"moduleResolution": "Node",
"rootDir": "src",
"outDir": "dist",
Expand Down

0 comments on commit 080e51d

Please sign in to comment.