Home

mint @cdfc76caf80fc73015bf0637d6b101cf50886472 - refs - log -
-
https://git.jolheiser.com/mint.git
Budget
mint / assets / esbuild.config.mjs
- raw -
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
import * as esbuild from 'esbuild';

const watch = process.argv.includes('--watch');

const ctx = await esbuild.context({
  entryPoints: ['src/main.js'],
  bundle: true,
  minify: !watch,
  sourcemap: watch,
  outfile: 'dist/bundle.js',
  target: ['es2020'],
});

if (watch) {
  await ctx.watch();
  console.log('watching for changes...');
} else {
  await ctx.rebuild();
  await ctx.dispose();
}