fix: fix hot-api for not build in bun app.mjs

This commit is contained in:
2025-12-05 20:53:25 +08:00
parent 94e331e376
commit ee33208e6c
9 changed files with 95 additions and 38 deletions

View File

@@ -6,6 +6,7 @@ import fs from 'node:fs';
// bun run src/index.ts --
import { fileURLToPath } from 'node:url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const external = ['pm2', '@kevisual/hot-api'];
/**
*
* @param {string} p
@@ -20,11 +21,10 @@ await Bun.build({
naming: {
entry: 'assistant.js',
},
external: ['pm2'],
external,
define: {
ENVISION_VERSION: JSON.stringify(pkg.version),
},
env: 'ENVISION_*',
});
await Bun.build({
@@ -38,8 +38,7 @@ await Bun.build({
define: {
ENVISION_VERSION: JSON.stringify(pkg.version),
},
external: ['pm2'],
env: 'ENVISION_*',
external,
});
// const copyDist = ['dist', 'bin'];
const copyDist = ['dist'];