Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dev): allow non-development modes for remix watch #7117

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/empty-cameras-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

allow non-development modes for remix watch
2 changes: 1 addition & 1 deletion packages/remix-dev/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export async function watch(
: await readConfig(remixRootOrConfig);

let resolved = await resolveDev(config);
void devServer.liveReload(config, resolved);
void devServer.liveReload(config, { ...resolved, mode });
return await new Promise(() => {});
}

Expand Down
4 changes: 2 additions & 2 deletions packages/remix-dev/devServer/liveReload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let clean = (config: RemixConfig) => {

export async function liveReload(
config: RemixConfig,
options: { port: number }
options: { port: number; mode: string }
) {
clean(config);
let wss = new WebSocket.Server({ port: options.port });
Expand All @@ -48,7 +48,7 @@ export async function liveReload(
{
config,
options: {
mode: "development",
mode: options.mode,
sourcemap: true,
},
fileWatchCache,
Expand Down