Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: lower target to support Webpack 4 #1085

Merged
merged 4 commits into from
Jun 18, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions scripts/bundle.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ES2020",
"target": "ES2019",
"moduleResolution": "Node",
"rootDir": "src",
"outDir": "dist",
Expand Down