feat: mature build script

This commit is contained in:
TresAbhi committed 2023-06-12 02:01:32 +00:00
1 parent 4be7852bf3
commit c685f86dc4
4 files changed
+27 -6

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import { build } from 'esbuild';
import { rmSync } from 'fs';
console.log('Removing dist...');
rmSync('dist', { recursive: true, force: true });
console.log('Creating context...');
build({
entryPoints: ['src/index.ts'],
outfile: 'dist/index.cjs',
platform: 'node',
loader: {
'.node': 'copy',
'.ttf': 'file',
},
bundle: true,
sourcemap: true,
minifyIdentifiers: false, // causes errors
minifySyntax: true,
minifyWhitespace: true,
});