zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit e863292fe2f280945d914e7e98fbc704b68f1004 (tree)
parent c650ccfca719b695fe7752f9126e8dbcc2ab4d6d
Author: Loris Cro <kappaloris@gmail.com>
Date:   Thu, 28 Jul 2022 15:08:58 +0200

autodoc: no whitespace in json output for release builds

With this change, stdlib autodocs go from 24mb to 16mb (-8mb).

Diffstat:
Msrc/Autodoc.zig | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Autodoc.zig b/src/Autodoc.zig @@ -1,3 +1,4 @@ +const builtin = @import("builtin"); const std = @import("std"); const build_options = @import("build_options"); const Autodoc = @This(); @@ -254,7 +255,7 @@ pub fn generateZirData(self: *Autodoc) !void { try std.json.stringify( data, .{ - .whitespace = .{}, + .whitespace = .{ .indent = if (builtin.mode == .Debug) .{ .Space = 4 } else .None }, .emit_null_optional_fields = false, }, out,