autodoc: no whitespace in json output for release builds

With this change, stdlib autodocs go from 24mb to 16mb (-8mb).
This commit is contained in:
Loris Cro 2022-07-28 15:08:58 +02:00
parent c650ccfca7
commit e863292fe2

View File

@ -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,