import path from 'node:path'; import pkg from './package.json'; import fs from 'node:fs'; // bun run src/index.ts -- import { fileURLToPath } from 'node:url'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); /** * * @param {string} p * @returns */ export const w = (p) => path.join(__dirname, p); await Bun.build({ target: 'node', format: 'esm', entrypoints: [w('./src/lib.ts')], outdir: w('./libs'), naming: { entry: 'assistant-lib.mjs', }, external: ['pm2'], define: { ENVISION_VERSION: JSON.stringify(pkg.version), }, env: 'ENVISION_*', });