15 lines
390 B
JavaScript
15 lines
390 B
JavaScript
import { build } from 'esbuild';
|
|
import { dirname, resolve } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
|
|
await build({
|
|
absWorkingDir: root,
|
|
entryPoints: [resolve(root, 'src/game.js')],
|
|
bundle: true,
|
|
format: 'esm',
|
|
target: 'es2020',
|
|
minify: true,
|
|
outfile: resolve(root, 'dist/game.js')
|
|
});
|