Skip to content

Commit 4287e68

Browse files
committed
Add helper environment comment
1 parent 60ef15d commit 4287e68

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/react-router-dev/vite/plugin.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,12 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => {
915915
};
916916
};
917917

918+
// We use a separate environment for loading the server manifest and inlined
919+
// CSS during development. This is because "ssrLoadModule" isn't available if
920+
// the "ssr" environment has been defined by another plugin (e.g.
921+
// vite-plugin-cloudflare) as a Vite.DevEnvironment rather than a
922+
// Vite.RunnableDevEnvironment:
923+
// https://vite.dev/guide/api-environment-frameworks.html#runtime-agnostic-ssr
918924
const HELPER_ENVIRONMENT_NAME = "__react_router_helper__";
919925

920926
const loadModule: LoadModule = (viteDevServer, url) => {

0 commit comments

Comments
 (0)