mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 11:59:00 +00:00
Fix bake codegen on windows (#17654)
This commit is contained in:
@@ -30,6 +30,16 @@ function convertZigEnum(zig: string, names: string[]) {
|
||||
return output;
|
||||
}
|
||||
|
||||
function css(file: string, is_development: boolean): string {
|
||||
const { success, stdout, stderr } = Bun.spawnSync({
|
||||
cmd: [process.execPath, "build", file, "--minify"],
|
||||
cwd: import.meta.dir,
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
});
|
||||
if (!success) throw new Error(stderr.toString("utf-8"));
|
||||
return stdout.toString("utf-8");
|
||||
}
|
||||
|
||||
async function run() {
|
||||
const devServerZig = readFileSync(join(base_dir, "DevServer.zig"), "utf-8");
|
||||
writeIfNotChanged(join(base_dir, "generated.ts"), convertZigEnum(devServerZig, ["IncomingMessageId", "MessageId"]));
|
||||
@@ -43,6 +53,7 @@ async function run() {
|
||||
side: JSON.stringify(side),
|
||||
IS_ERROR_RUNTIME: String(file === "error"),
|
||||
IS_BUN_DEVELOPMENT: String(!!debug),
|
||||
OVERLAY_CSS: css("../bake/client/overlay.css", !!debug),
|
||||
},
|
||||
minify: {
|
||||
syntax: !debug,
|
||||
|
||||
Reference in New Issue
Block a user