aboutsummaryrefslogtreecommitdiff
path: root/src/cli.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.zig')
-rw-r--r--src/cli.zig15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/cli.zig b/src/cli.zig
index e5065fd79..61e236bad 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -165,6 +165,10 @@ pub const Arguments = struct {
clap.parseParam("-l, --loader <STR>... Parse files with .ext:loader, e.g. --loader .js:jsx. Valid loaders: jsx, js, json, tsx, ts, css") 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("--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,
+ clap.parseParam("--minify-identifiers Minify identifiers") catch unreachable,
clap.parseParam("<POS>... ") catch unreachable,
};
@@ -208,8 +212,6 @@ pub const Arguments = struct {
clap.parseParam("--server-components Enable React Server Components (experimental)") catch unreachable,
clap.parseParam("--splitting Split up code!") catch unreachable,
clap.parseParam("--transform Do not bundle") catch unreachable,
- clap.parseParam("--minify-syntax Minify syntax and inline data (experimental)") catch unreachable,
- clap.parseParam("--minify-whitespace Minify whitespace (experimental)") catch unreachable,
};
// TODO: update test completions
@@ -476,10 +478,14 @@ pub const Arguments = struct {
const production = false;
var output_file: ?string = null;
+ const minify_flag = args.flag("--minify");
+ ctx.bundler_options.minify_syntax = minify_flag or args.flag("--minify-syntax");
+ ctx.bundler_options.minify_whitespace = minify_flag or args.flag("--minify-whitespace");
+ ctx.bundler_options.minify_identifiers = minify_flag or args.flag("--minify-identifiers");
+
if (cmd == .BuildCommand) {
ctx.bundler_options.transform_only = args.flag("--transform");
- ctx.bundler_options.minify_syntax = args.flag("--minify-syntax");
- ctx.bundler_options.minify_whitespace = args.flag("--minify-whitespace");
+
if (args.option("--outdir")) |outdir| {
if (outdir.len > 0) {
ctx.bundler_options.outdir = outdir;
@@ -922,6 +928,7 @@ pub const Command = struct {
transform_only: bool = false,
minify_syntax: bool = false,
minify_whitespace: bool = false,
+ minify_identifiers: bool = false,
};
const _ctx = Command.Context{