Skip to content

Commit ca057a0

Browse files
Add unstable Vite Environment API support (remix-run#12936)
1 parent ac399b7 commit ca057a0

File tree

21 files changed

+1920
-1420
lines changed

21 files changed

+1920
-1420
lines changed

.changeset/thin-rockets-fly.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-router/dev": patch
3+
---
4+
5+
Add `future.unstable_viteEnvironmentApi` flag to enable experimental Vite Environment API support

integration/helpers/vite.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import type { Config } from "@react-router/dev/config";
1818

1919
const require = createRequire(import.meta.url);
2020

21-
const reactRouterBin = "node_modules/@react-router/dev/dist/cli/index.js";
21+
const reactRouterBin = "node_modules/@react-router/dev/bin.js";
2222
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
2323
const root = path.resolve(__dirname, "../..");
2424
const TMP_DIR = path.join(root, ".tmp/integration");
@@ -29,6 +29,7 @@ export const reactRouterConfig = ({
2929
prerender,
3030
appDirectory,
3131
splitRouteModules,
32+
viteEnvironmentApi,
3233
}: {
3334
ssr?: boolean;
3435
basename?: string;
@@ -37,6 +38,7 @@ export const reactRouterConfig = ({
3738
splitRouteModules?: NonNullable<
3839
Config["future"]
3940
>["unstable_splitRouteModules"];
41+
viteEnvironmentApi?: boolean;
4042
}) => {
4143
let config: Config = {
4244
ssr,
@@ -45,6 +47,7 @@ export const reactRouterConfig = ({
4547
appDirectory,
4648
future: {
4749
unstable_splitRouteModules: splitRouteModules,
50+
unstable_viteEnvironmentApi: viteEnvironmentApi,
4851
},
4952
};
5053

@@ -130,7 +133,7 @@ export const EXPRESS_SERVER = (args: {
130133
app.listen(port, () => console.log('http://localhost:' + port));
131134
`;
132135

133-
type TemplateName =
136+
export type TemplateName =
134137
| "vite-5-template"
135138
| "vite-6-template"
136139
| "vite-cloudflare-template";

0 commit comments

Comments
 (0)