-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vite): remove virtual server build ID export (#8264)
- Loading branch information
1 parent
26c3df6
commit 825a907
Showing
9 changed files
with
39 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
"@remix-run/dev": patch | ||
--- | ||
|
||
Remove `unstable_viteServerBuildModuleId` in favor of manually referencing virtual module name `"virtual:remix/server-build"`. | ||
|
||
**This is a breaking change for projects using the unstable Vite plugin with a custom server.** | ||
|
||
This change was made to avoid issues where `@remix-run/dev` could be inadvertently required in your server's production dependencies. | ||
|
||
Instead, you should manually write the virtual module name `"virtual:remix/server-build"` when calling `ssrLoadModule` in development. | ||
|
||
```diff | ||
-import { unstable_viteServerBuildModuleId } from "@remix-run/dev"; | ||
|
||
// ... | ||
|
||
app.all( | ||
"*", | ||
createRequestHandler({ | ||
build: vite | ||
- ? () => vite.ssrLoadModule(unstable_viteServerBuildModuleId) | ||
+ ? () => vite.ssrLoadModule("virtual:remix/server-build") | ||
: await import("./build/server/index.js"), | ||
}) | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export let id = (name: string) => `virtual:${name}`; | ||
export let id = (name: string) => `virtual:remix/${name}`; | ||
export let resolve = (id: string) => `\0${id}`; | ||
export let url = (id: string) => `/@id/__x00__${id}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters