25 lines
589 B
JavaScript
25 lines
589 B
JavaScript
import { build } from 'esbuild';
|
|
import commandLineArgs from 'command-line-args';
|
|
|
|
const args = commandLineArgs([
|
|
{ name: 'watch', alias: 'w', type: Boolean },
|
|
{ name: 'bundle', alias: 'b', type: Boolean },
|
|
{ name: 'minify', alias: 'm', type: Boolean },
|
|
{ name: 'sourcemap', alias: 's', type: Boolean }
|
|
]);
|
|
|
|
//build TS
|
|
build({
|
|
entryPoints: ['src/main.ts'],
|
|
outdir: 'dist',
|
|
|
|
target: 'es2020',
|
|
platform: 'node',
|
|
format: 'cjs',
|
|
|
|
watch: args.watch,
|
|
bundle: args.bundle,
|
|
minify: args.minify,
|
|
sourcemap: args.sourcemap
|
|
});
|