From 5e5e7c60f1004c79a3f87e1f5470ee19d57f10d0 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Fri, 1 Nov 2024 20:41:20 -0700 Subject: [PATCH] Fix release build --- src/cli.zig | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/cli.zig b/src/cli.zig index d6a863a97ef6d2..19f64c55e1a98e 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -769,9 +769,11 @@ pub const Arguments = struct { ctx.bundler_options.transform_only = args.flag("--no-bundle"); ctx.bundler_options.bytecode = args.flag("--bytecode"); - if (args.flag("--app")) { - ctx.bundler_options.bake = true; - ctx.bundler_options.bake_debug_dump_server = args.flag("--debug-dump-server-files"); + if (comptime FeatureFlags.bake) { + if (args.flag("--app")) { + ctx.bundler_options.bake = true; + ctx.bundler_options.bake_debug_dump_server = args.flag("--debug-dump-server-files"); + } } // TODO: support --format=esm @@ -933,19 +935,21 @@ pub const Arguments = struct { ctx.bundler_options.asset_naming = try strings.concat(allocator, &.{ "./", bun.strings.removeLeadingDotSlash(asset_naming) }); } - if (args.flag("--server-components")) { - if (!bun.FeatureFlags.cli_server_components) { - // TODO: i want to disable this in non-canary - // but i also want to have tests that can run for PRs - } - ctx.bundler_options.server_components = true; - if (opts.target) |target| { - if (!bun.options.Target.from(target).isServerSide()) { - bun.Output.errGeneric("Cannot use client-side --target={s} with --server-components", .{@tagName(target)}); - Global.crash(); + if (comptime FeatureFlags.bake) { + if (args.flag("--server-components")) { + if (!bun.FeatureFlags.cli_server_components) { + // TODO: i want to disable this in non-canary + // but i also want to have tests that can run for PRs + } + ctx.bundler_options.server_components = true; + if (opts.target) |target| { + if (!bun.options.Target.from(target).isServerSide()) { + bun.Output.errGeneric("Cannot use client-side --target={s} with --server-components", .{@tagName(target)}); + Global.crash(); + } + } else { + opts.target = .bun; } - } else { - opts.target = .bun; } }