aboutsummaryrefslogtreecommitdiff
path: root/src/cli.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-16 21:17:47 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-16 21:17:47 -0700
commitdc766eb18a2b457393f7f13668d3f6640406aff4 (patch)
treee208e6c2c466c2d29b148e36805152df599d027b /src/cli.zig
parent209dc981c0ef52de5c80eab5d24ec8a8eba765e8 (diff)
downloadbun-dc766eb18a2b457393f7f13668d3f6640406aff4.tar.gz
bun-dc766eb18a2b457393f7f13668d3f6640406aff4.tar.zst
bun-dc766eb18a2b457393f7f13668d3f6640406aff4.zip
Add `--smol` flag
Diffstat (limited to 'src/cli.zig')
-rw-r--r--src/cli.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cli.zig b/src/cli.zig
index f0cc47918..0c093681a 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -153,6 +153,7 @@ pub const Arguments = struct {
clap.parseParam("-l, --loader <STR>... Parse files with .ext:loader, e.g. --loader .js:jsx. Valid loaders: js, jsx, ts, tsx, json, toml, text, file, wasm, napi") catch unreachable,
clap.parseParam("-u, --origin <STR> Rewrite import URLs to start with --origin. Default: \"\"") catch unreachable,
clap.parseParam("-p, --port <STR> Port to serve bun's dev server on. Default: \"3000\"") catch unreachable,
+ clap.parseParam("--smol Use less memory, but run garbage collection more often") catch unreachable,
clap.parseParam("--minify Minify (experimental)") catch unreachable,
clap.parseParam("--minify-syntax Minify syntax and inline data (experimental)") catch unreachable,
clap.parseParam("--minify-whitespace Minify whitespace (experimental)") catch unreachable,
@@ -479,6 +480,8 @@ pub const Arguments = struct {
} else if (preloads.len > 0) {
ctx.preloads = preloads;
}
+
+ ctx.runtime_options.smol = args.flag("--smol");
}
if (opts.port != null and opts.origin == null) {
@@ -960,10 +963,15 @@ pub const Command = struct {
debug: DebugOptions = DebugOptions{},
test_options: TestOptions = TestOptions{},
bundler_options: BundlerOptions = BundlerOptions{},
+ runtime_options: RuntimeOptions = RuntimeOptions{},
preloads: []const string = &[_]string{},
has_loaded_global_config: bool = false,
+ pub const RuntimeOptions = struct {
+ smol: bool = false,
+ };
+
pub const BundlerOptions = struct {
compile: bool = false,