Skip to content

Commit

Permalink
Fix release build
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Nov 2, 2024
1 parent 85fd471 commit 5e5e7c6
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions src/cli.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 5e5e7c6

Please sign in to comment.