变更命令

This commit is contained in:
mtvpls
2026-06-18 13:27:38 +08:00
parent 8997228be4
commit ce944e6bc5
4 changed files with 35 additions and 6 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/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);
});