diff options
Diffstat (limited to 'src/cli/build_command.zig')
-rw-r--r-- | src/cli/build_command.zig | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/cli/build_command.zig b/src/cli/build_command.zig index 14414c7de..ef99f7765 100644 --- a/src/cli/build_command.zig +++ b/src/cli/build_command.zig @@ -107,6 +107,7 @@ pub const BuildCommand = struct { // We never want to hit the filesystem for these files // This "compiled" protocol is specially handled by the module resolver. this_bundler.options.public_path = "compiled://root/"; + this_bundler.resolver.opts.public_path = "compiled://root/"; if (outfile.len == 0) { outfile = std.fs.path.basename(this_bundler.options.entry_points[0]); @@ -320,8 +321,8 @@ pub const BuildCommand = struct { var from_path = resolve_path.longestCommonPath(all_paths); for (output_files) |f| { - max_path_len = std.math.max( - std.math.max(from_path.len, f.dest_path.len) + 2 - from_path.len, + max_path_len = @max( + @max(from_path.len, f.dest_path.len) + 2 - from_path.len, max_path_len, ); } @@ -356,7 +357,7 @@ pub const BuildCommand = struct { Output.pretty("{s}", .{padding_buf[0..@intCast(usize, compiled_elapsed_digit_count)]}); - Output.printElapsedStdoutTrim(@intToFloat(f64, compiled_elapsed)); + Output.printElapsedStdoutTrim(@floatFromInt(f64, compiled_elapsed)); Output.prettyln(" <green>compile<r> <b><blue>{s}<r>", .{ outfile, @@ -446,11 +447,11 @@ pub const BuildCommand = struct { // Print summary _ = try writer.write("\n"); - const padding_count = 2 + (std.math.max(rel_path.len, max_path_len) - rel_path.len); + const padding_count = 2 + (@max(rel_path.len, max_path_len) - rel_path.len); try writer.writeByteNTimes(' ', 2); try writer.writeAll(rel_path); try writer.writeByteNTimes(' ', padding_count); - const size = @intToFloat(f64, f.size) / 1000.0; + const size = @floatFromInt(f64, f.size) / 1000.0; try std.fmt.formatFloatDecimal(size, .{ .precision = 2 }, writer); try writer.writeAll(" KB\n"); } @@ -460,7 +461,7 @@ pub const BuildCommand = struct { if (write_summary and log.errors == 0) { Output.prettyln("\n", .{}); Output.printElapsedStdoutTrim( - @intToFloat(f64, (@divTrunc(@truncate(i64, std.time.nanoTimestamp() - bun.CLI.start_time), @as(i64, std.time.ns_per_ms)))), + @floatFromInt(f64, (@divTrunc(@truncate(i64, std.time.nanoTimestamp() - bun.CLI.start_time), @as(i64, std.time.ns_per_ms)))), ); if (this_bundler.options.transform_only) { Output.prettyln(" <green>transpile<r>", .{}); @@ -505,7 +506,7 @@ fn printSummary(bundled_end: i128, minify_duration: u64, minified: bool, input_c }; if (minified) { Output.pretty("{s}", .{padding_buf[0..@intCast(usize, minified_digit_count)]}); - Output.printElapsedStdoutTrim(@intToFloat(f64, minify_duration)); + Output.printElapsedStdoutTrim(@floatFromInt(f64, minify_duration)); const output_size = brk: { var total_size: u64 = 0; for (output_files) |f| { @@ -547,7 +548,7 @@ fn printSummary(bundled_end: i128, minify_duration: u64, minified: bool, input_c }; Output.pretty("{s}", .{padding_buf[0..@intCast(usize, bundle_elapsed_digit_count)]}); - Output.printElapsedStdoutTrim(@intToFloat(f64, bundle_elapsed)); + Output.printElapsedStdoutTrim(@floatFromInt(f64, bundle_elapsed)); Output.prettyln( " <green>bundle<r> {d} modules", .{ |