Files
MoonTVPlus/scripts/edgeone-build.mjs
T
2026-06-18 13:27:38 +08:00

27 lines
601 B
JavaScript

#!/usr/bin/env node
import { spawn } from 'node:child_process';
const isInsideEdgeOneBuilder = process.env.NEXT_PRIVATE_STANDALONE === 'true';
const command = isInsideEdgeOneBuilder
? 'BUILD_TARGET=edgeone EDGEONE_PAGES=1 pnpm build'
: 'BUILD_TARGET=edgeone EDGEONE_PAGES=1 edgeone makers build';
const child = spawn(command, {
stdio: 'inherit',
shell: true,
env: {
...process.env,
BUILD_TARGET: 'edgeone',
EDGEONE_PAGES: '1',
},
});
child.on('exit', (code, signal) => {
if (signal) {
process.kill(process.pid, signal);
return;
}
process.exit(code ?? 1);
});