diff options
author | 2022-03-07 00:33:49 -0800 | |
---|---|---|
committer | 2022-03-07 00:33:49 -0800 | |
commit | d43a6455359062b2c67f914d2f56d7d1ce3044a7 (patch) | |
tree | 456b6a9359f10cc2aae5f53fe18a8dd223969929 /src/api/schema.zig | |
parent | 50d5b872f9a008be02b3c36a7fa34cabef5718f6 (diff) | |
download | bun-d43a6455359062b2c67f914d2f56d7d1ce3044a7.tar.gz bun-d43a6455359062b2c67f914d2f56d7d1ce3044a7.tar.zst bun-d43a6455359062b2c67f914d2f56d7d1ce3044a7.zip |
source maps optimizations
Diffstat (limited to 'src/api/schema.zig')
-rw-r--r-- | src/api/schema.zig | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/api/schema.zig b/src/api/schema.zig index 5f4532522..2374103eb 100644 --- a/src/api/schema.zig +++ b/src/api/schema.zig @@ -1744,6 +1744,9 @@ pub const Api = struct { /// logLevel log_level: ?MessageLevel = null, + /// source_map + source_map: ?SourceMapMode = null, + pub fn decode(reader: anytype) anyerror!TransformOptions { var this = std.mem.zeroes(TransformOptions); @@ -1831,6 +1834,9 @@ pub const Api = struct { 26 => { this.log_level = try reader.readValue(MessageLevel); }, + 27 => { + this.source_map = try reader.readValue(SourceMapMode); + }, else => { return error.InvalidMessage; }, @@ -1944,10 +1950,29 @@ pub const Api = struct { try writer.writeFieldID(26); try writer.writeEnum(log_level); } + if (this.source_map) |source_map| { + try writer.writeFieldID(27); + try writer.writeEnum(source_map); + } try writer.endMessage(); } }; + pub const SourceMapMode = enum(u8) { + _none, + /// inline_into_file + inline_into_file, + + /// external + external, + + _, + + pub fn jsonStringify(self: *const @This(), opts: anytype, o: anytype) !void { + return try std.json.stringify(@tagName(self), opts, o); + } + }; + pub const FileHandle = struct { /// path path: []const u8, |