Integrate CSS with bundler (#14281)

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Zack Radisic <zackradisic@Mac.attlocal.net>
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
Co-authored-by: Zack Radisic <zackradisic@Zacks-MBP.attlocal.net>
This commit is contained in:
Zack Radisic
2024-10-04 20:23:10 -07:00
committed by GitHub
parent 3ab3dec34d
commit a01f9d8e1b
49 changed files with 3803 additions and 1455 deletions

View File

@@ -280,6 +280,7 @@ pub const Arguments = struct {
clap.parseParam("--minify-syntax Minify syntax and inline data") catch unreachable,
clap.parseParam("--minify-whitespace Minify whitespace") catch unreachable,
clap.parseParam("--minify-identifiers Minify identifiers") catch unreachable,
clap.parseParam("--experimental-css Enabled experimental CSS bundling") catch unreachable,
clap.parseParam("--dump-environment-variables") catch unreachable,
clap.parseParam("--conditions <STR>... Pass custom conditions to resolve") catch unreachable,
};
@@ -777,6 +778,9 @@ pub const Arguments = struct {
ctx.bundler_options.public_path = public_path;
}
const experimental_css = args.flag("--experimental-css");
ctx.bundler_options.experimental_css = experimental_css;
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");
@@ -1398,6 +1402,7 @@ pub const Command = struct {
emit_dce_annotations: bool = true,
output_format: options.Format = .esm,
bytecode: bool = false,
experimental_css: bool = false,
};
pub fn create(allocator: std.mem.Allocator, log: *logger.Log, comptime command: Command.Tag) anyerror!Context {