diff options
author | 2023-05-31 19:17:01 -0700 | |
---|---|---|
committer | 2023-05-31 19:17:01 -0700 | |
commit | cb0f76aa73f6b85667b57015a77ac39d9c78aa0b (patch) | |
tree | 949bcc466b3afbbb69a070d35d2b814f0e66be40 /src/cli.zig | |
parent | 79d7b2075e63f79ec6d1d2a904178969eb701f0b (diff) | |
parent | 110d0752f333e4c32c9226e4a94e93f18837f9c7 (diff) | |
download | bun-cb0f76aa73f6b85667b57015a77ac39d9c78aa0b.tar.gz bun-cb0f76aa73f6b85667b57015a77ac39d9c78aa0b.tar.zst bun-cb0f76aa73f6b85667b57015a77ac39d9c78aa0b.zip |
Merge branch 'main' into jarred/port
Diffstat (limited to 'src/cli.zig')
-rw-r--r-- | src/cli.zig | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cli.zig b/src/cli.zig index 0ad948ac7..dc1ae0cdc 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -157,6 +157,7 @@ pub const Arguments = struct { clap.parseParam("--minify-syntax Minify syntax and inline data (experimental)") catch unreachable, clap.parseParam("--minify-whitespace Minify whitespace (experimental)") catch unreachable, clap.parseParam("--minify-identifiers Minify identifiers") catch unreachable, + clap.parseParam("--no-macros Disable macros from being executed in the bundler, transpiler and runtime") catch unreachable, clap.parseParam("--target <STR> The intended execution environment for the bundle. \"browser\", \"bun\" or \"node\"") catch unreachable, clap.parseParam("<POS>... ") catch unreachable, }; @@ -744,6 +745,10 @@ pub const Arguments = struct { ctx.log.level = logger.Log.default_log_level; } + if (args.flag("--no-macros")) { + ctx.debug.macros = .{ .disable = {} }; + } + opts.output_dir = output_dir; if (output_file != null) ctx.debug.output_file = output_file.?; @@ -898,7 +903,7 @@ pub const Command = struct { loaded_bunfig: bool = false, // technical debt - macros: ?MacroMap = null, + macros: MacroOptions = MacroOptions.unspecified, editor: string = "", package_bundle_map: bun.StringArrayHashMapUnmanaged(options.BundlePackage) = bun.StringArrayHashMapUnmanaged(options.BundlePackage){}, @@ -906,6 +911,8 @@ pub const Command = struct { output_file: []const u8 = "", }; + pub const MacroOptions = union(enum) { unspecified: void, disable: void, map: MacroMap }; + pub const HotReload = enum { none, hot, |