mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-08-17 11:37:20 +08:00
v0.3.8
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { spawn } from "child_process";
|
||||
import { createRequire } from "module";
|
||||
import path from "path";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const vitePackagePath = require.resolve("vite/package.json");
|
||||
const viteBin = path.join(path.dirname(vitePackagePath), "bin", "vite.js");
|
||||
const extraArgs = process.argv.slice(2);
|
||||
const shouldScan = extraArgs.includes("--scan");
|
||||
const forwardedArgs = extraArgs.filter((arg) => arg !== "--scan");
|
||||
|
||||
const child = spawn(process.execPath, [viteBin, "build", ...forwardedArgs], {
|
||||
stdio: "inherit",
|
||||
env: {
|
||||
...process.env,
|
||||
STATIC_I18N_SCAN: shouldScan ? "true" : process.env.STATIC_I18N_SCAN || "false",
|
||||
},
|
||||
});
|
||||
|
||||
child.on("exit", (code, signal) => {
|
||||
if (signal) {
|
||||
process.kill(process.pid, signal);
|
||||
return;
|
||||
}
|
||||
|
||||
process.exit(code ?? 0);
|
||||
});
|
||||
Reference in New Issue
Block a user