From e863292fe2f280945d914e7e98fbc704b68f1004 Mon Sep 17 00:00:00 2001 From: Loris Cro Date: Thu, 28 Jul 2022 15:08:58 +0200 Subject: [PATCH] autodoc: no whitespace in json output for release builds With this change, stdlib autodocs go from 24mb to 16mb (-8mb). --- src/Autodoc.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Autodoc.zig b/src/Autodoc.zig index 763df8a7a7..2d163bf4f0 100644 --- 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,