chore: use bun instead of npm when running dev script under bun (#2946)
Reviewed-on: #2946 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
parent
e3048ea188
commit
654652b889
@ -10,7 +10,6 @@
|
||||
"build:dev": "tsgo --inlineSourceMap",
|
||||
"build:dev:tsc": "tsc --incremental --inlineSourceMap",
|
||||
"build-and-start": "npm run build && npm run start",
|
||||
"build-and-start:bun": "npm run verify && npm run bun-run",
|
||||
"dev": "node scripts/dev.cjs",
|
||||
"dev:bun": "bun scripts/dev.cjs",
|
||||
"verify": "tsgo --noEmit",
|
||||
|
||||
@ -40,7 +40,11 @@ function run(changedFile) {
|
||||
runproc = undefined;
|
||||
}
|
||||
|
||||
const thisbuildproc = spawn("npm", ["run", cangoraw ? "verify" : "build:dev"], spawnopts);
|
||||
const thisbuildproc = spawn(
|
||||
process.versions.bun ? "bun" : "npm",
|
||||
["run", cangoraw ? "verify" : "build:dev"],
|
||||
spawnopts
|
||||
);
|
||||
const thisbuildstart = Date.now();
|
||||
buildproc = thisbuildproc;
|
||||
buildproc.on("exit", code => {
|
||||
@ -51,7 +55,7 @@ function run(changedFile) {
|
||||
if (code === 0) {
|
||||
console.log(`${cangoraw ? "Verified" : "Built"} in ${Date.now() - thisbuildstart} ms`);
|
||||
runproc = spawn(
|
||||
"npm",
|
||||
process.versions.bun ? "bun" : "npm",
|
||||
["run", cangoraw ? (process.versions.bun ? "raw:bun" : "raw") : "start", "--", ...args],
|
||||
spawnopts
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user