mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Add flag to dev server to disable HMR
This commit is contained in:
1
src/api/schema.d.ts
vendored
1
src/api/schema.d.ts
vendored
@@ -468,6 +468,7 @@ type uint32 = number;
|
||||
framework?: FrameworkConfig;
|
||||
router?: RouteConfig;
|
||||
no_summary?: boolean;
|
||||
disable_hmr?: boolean;
|
||||
}
|
||||
|
||||
export interface FileHandle {
|
||||
|
||||
@@ -1707,6 +1707,10 @@ function decodeTransformOptions(bb) {
|
||||
result["no_summary"] = !!bb.readByte();
|
||||
break;
|
||||
|
||||
case 24:
|
||||
result["disable_hmr"] = !!bb.readByte();
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error("Attempted to parse invalid message");
|
||||
}
|
||||
@@ -1881,6 +1885,12 @@ bb.writeByte(encoded);
|
||||
bb.writeByte(23);
|
||||
bb.writeByte(value);
|
||||
}
|
||||
|
||||
var value = message["disable_hmr"];
|
||||
if (value != null) {
|
||||
bb.writeByte(24);
|
||||
bb.writeByte(value);
|
||||
}
|
||||
bb.writeByte(0);
|
||||
|
||||
}
|
||||
|
||||
@@ -337,6 +337,8 @@ message TransformOptions {
|
||||
FrameworkConfig framework = 21;
|
||||
RouteConfig router = 22;
|
||||
bool no_summary = 23;
|
||||
|
||||
bool disable_hmr = 24;
|
||||
}
|
||||
|
||||
struct FileHandle {
|
||||
|
||||
4802
src/api/schema.zig
4802
src/api/schema.zig
File diff suppressed because it is too large
Load Diff
@@ -150,7 +150,7 @@ pub const Arguments = struct {
|
||||
|
||||
pub const ParamType = clap.Param(clap.Help);
|
||||
|
||||
const params: [24]ParamType = brk: {
|
||||
const params: [25]ParamType = brk: {
|
||||
@setEvalBranchQuota(9999);
|
||||
break :brk [_]ParamType{
|
||||
clap.parseParam("--use <STR> Choose a framework, e.g. \"--use next\". It checks first for a package named \"bun-framework-packagename\" and then \"packagename\".") catch unreachable,
|
||||
@@ -158,6 +158,7 @@ pub const Arguments = struct {
|
||||
clap.parseParam("--server-bunfile <STR> Use a .server.bun file (default: node_modules.server.bun)") catch unreachable,
|
||||
clap.parseParam("--cwd <STR> Absolute path to resolve files & entry points from. This just changes the process' cwd.") catch unreachable,
|
||||
clap.parseParam("--disable-react-fast-refresh Disable React Fast Refresh") catch unreachable,
|
||||
clap.parseParam("--disable-hmr Disable Hot Module Reloading (disables fast refresh too)") catch unreachable,
|
||||
clap.parseParam("--extension-order <STR>... defaults to: .tsx,.ts,.jsx,.js,.json ") catch unreachable,
|
||||
clap.parseParam("--jsx-factory <STR> Changes the function called when compiling JSX elements using the classic JSX runtime") catch unreachable,
|
||||
clap.parseParam("--jsx-fragment <STR> Changes the function called when compiling JSX fragments using the classic JSX runtime") catch unreachable,
|
||||
@@ -239,6 +240,7 @@ pub const Arguments = struct {
|
||||
.extension_order = args.options("--extension-order"),
|
||||
.entry_points = undefined,
|
||||
.no_summary = args.flag("--no-summary"),
|
||||
.disable_hmr = args.flag("--disable-hmr"),
|
||||
};
|
||||
|
||||
const print_help = args.flag("--help");
|
||||
|
||||
Reference in New Issue
Block a user