// Bundles the server into one file. Dependencies stay external and are installed in the image. import fs from 'node:fs'; import { build } from 'esbuild'; await build({ entryPoints: ['server/main.ts'], outfile: 'dist/server/main.js', bundle: true, platform: 'node', format: 'esm', target: 'node24', packages: 'external', sourcemap: true, logLevel: 'info', }); // The Python sandbox runs as its own (permission-restricted) process, so it ships as a file. fs.copyFileSync('server/python-runner.mjs', 'dist/server/python-runner.mjs');