aboutsummaryrefslogtreecommitdiffhomepage
path: root/esbuild.mjs
blob: d259a4656828596b6453d2ff76128a3f9b0917f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { build } from 'esbuild'

let ALBATROSS_BASE_PATH = process.env.ALBATROSS_BASE_PATH;
if (ALBATROSS_BASE_PATH == null) {
  throw new Error('$ALBATROSS_BASE_PATH is not set');
}

await build({
  entryPoints: ['assets/index.js', 'assets/chart.js', 'assets/loading.js'],
  outdir: 'archive/assets',
  bundle: true,
  minify: true,
  sourcemap: true,
  define: {
    'process.env.ALBATROSS_BASE_PATH': JSON.stringify(ALBATROSS_BASE_PATH),
  },
});