mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
this kind of works, but there is a crash when bundling. I think its missing a Stmt.Data.Store.reset()
Former-commit-id: 88aad6aeb1
This commit is contained in:
@@ -130,6 +130,7 @@ pub const Cli = struct {
|
||||
clap.parseParam("--scan Instead of bundling or transpiling, print a list of every file imported by an entry point, recursively") catch unreachable,
|
||||
clap.parseParam("--new-jsb Generate a new node_modules.jsb file from node_modules and entry point(s)") catch unreachable,
|
||||
clap.parseParam("--jsb <STR> Use a Speedy JavaScript Bundle (default: \"./node_modules.jsb\" if exists)") catch unreachable,
|
||||
clap.parseParam("--framework <STR> Use a JavaScript framework (file path) with --serve") catch unreachable,
|
||||
// clap.parseParam("--no-jsb Use a Speedy JavaScript Bundle (default: \"./node_modules.jsb\" if exists)") catch unreachable,
|
||||
clap.parseParam("<POS>... Entry points to use") catch unreachable,
|
||||
};
|
||||
@@ -183,6 +184,8 @@ pub const Cli = struct {
|
||||
var jsx_production = args.flag("--jsx-production");
|
||||
var react_fast_refresh = false;
|
||||
|
||||
var javascript_framework = args.option("--framework");
|
||||
|
||||
if (serve or args.flag("--new-jsb")) {
|
||||
react_fast_refresh = true;
|
||||
if (args.flag("--disable-react-fast-refresh") or jsx_production) {
|
||||
@@ -280,6 +283,10 @@ pub const Cli = struct {
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
if (!serve) {
|
||||
javascript_framework = null;
|
||||
}
|
||||
|
||||
return Api.TransformOptions{
|
||||
.jsx = jsx,
|
||||
.output_dir = output_dir,
|
||||
@@ -307,6 +314,7 @@ pub const Cli = struct {
|
||||
.platform = platform,
|
||||
.only_scan_dependencies = if (args.flag("--scan")) Api.ScanDependencyMode.all else Api.ScanDependencyMode._none,
|
||||
.generate_node_module_bundle = if (args.flag("--new-jsb")) true else false,
|
||||
.javascript_framework_file = javascript_framework,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user