diff options
Diffstat (limited to 'src/bun.js/api/transpiler.zig')
| -rw-r--r-- | src/bun.js/api/transpiler.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bun.js/api/transpiler.zig b/src/bun.js/api/transpiler.zig index 341a0d9db..24104c2b7 100644 --- a/src/bun.js/api/transpiler.zig +++ b/src/bun.js/api/transpiler.zig @@ -104,6 +104,9 @@ const TranspilerOptions = struct { tree_shaking: bool = false, trim_unused_imports: ?bool = null, inlining: bool = false, + + minify_whitespace: bool = false, + minify_identifiers: bool = false, }; // Mimalloc gets unstable if we try to move this to a different thread @@ -560,6 +563,10 @@ fn transformOptionsFromJSC(ctx: JSC.C.JSContextRef, temp_allocator: std.mem.Allo transpiler.runtime.inlining = flag.toBoolean(); } + if (object.get(globalThis, "minifyWhitespace")) |flag| { + transpiler.minify_whitespace = flag.toBoolean(); + } + if (object.get(globalThis, "sourcemap")) |flag| { if (flag.isBoolean() or flag.isUndefinedOrNull()) { if (flag.toBoolean()) { @@ -785,6 +792,7 @@ pub fn constructor( bundler.options.macro_remap = transpiler_options.macro_map; } + bundler.options.minify_whitespace = transpiler_options.minify_whitespace; bundler.options.tree_shaking = transpiler_options.tree_shaking; bundler.options.trim_unused_imports = transpiler_options.trim_unused_imports; bundler.options.allow_runtime = transpiler_options.runtime.allow_runtime; |
