react-router-hono-server 2.9.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.js +22 -4
- package/package.json +1 -1
package/dist/dev.js
CHANGED
|
@@ -37,6 +37,11 @@ function reactRouterHonoServer(options = {}) {
|
|
|
37
37
|
if (!pluginConfig) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
+
if (pluginConfig.future.unstable_viteEnvironmentApi) {
|
|
41
|
+
console.warn(
|
|
42
|
+
"\x1B[33mThe unstable_viteEnvironmentApi is enabled.\nThis is experimental and may break your build.\x1B[0m\n"
|
|
43
|
+
);
|
|
44
|
+
}
|
|
40
45
|
if (runtime === "cloudflare" && !config.plugins?.find((p) => p && "name" in p && p.name === "react-router-cloudflare-vite-dev-proxy")) {
|
|
41
46
|
console.warn(
|
|
42
47
|
`\x1B[31mMissing cloudflareDevProxy() in your vite.config.ts.
|
|
@@ -59,7 +64,7 @@ Please add it to your plugins: import { cloudflareDevProxy } from "@react-router
|
|
|
59
64
|
noExternal: ["react-router-hono-server"]
|
|
60
65
|
}
|
|
61
66
|
};
|
|
62
|
-
if (!pluginConfig.isSsrBuild) {
|
|
67
|
+
if (!pluginConfig.future.unstable_viteEnvironmentApi && !pluginConfig.isSsrBuild) {
|
|
63
68
|
return baseConfig;
|
|
64
69
|
}
|
|
65
70
|
let reactRouterBuildFile = pluginConfig.serverBuildFile;
|
|
@@ -73,8 +78,7 @@ Please add it to your plugins: import { cloudflareDevProxy } from "@react-router
|
|
|
73
78
|
"react-dom/server": reactVersion >= 19 ? "react-dom/server.edge" : "react-dom/server.browser"
|
|
74
79
|
};
|
|
75
80
|
}
|
|
76
|
-
|
|
77
|
-
...baseConfig,
|
|
81
|
+
const ssrConfig = {
|
|
78
82
|
resolve: {
|
|
79
83
|
alias
|
|
80
84
|
},
|
|
@@ -97,6 +101,18 @@ Please add it to your plugins: import { cloudflareDevProxy } from "@react-router
|
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
};
|
|
104
|
+
if (pluginConfig.future.unstable_viteEnvironmentApi) {
|
|
105
|
+
return {
|
|
106
|
+
...baseConfig,
|
|
107
|
+
environments: {
|
|
108
|
+
ssr: ssrConfig
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
...baseConfig,
|
|
114
|
+
...ssrConfig
|
|
115
|
+
};
|
|
100
116
|
},
|
|
101
117
|
async closeBundle() {
|
|
102
118
|
if (!pluginConfig || !pluginConfig.isSsrBuild || runtime !== "cloudflare") {
|
|
@@ -171,6 +187,7 @@ function resolvePluginConfig(config, options) {
|
|
|
171
187
|
const serverEntryPoint = options.serverEntryPoint || findDefaultServerEntry(appDirectory);
|
|
172
188
|
const serverBuildFile = reactRouterConfig.serverBuildFile;
|
|
173
189
|
const basename = reactRouterConfig.basename;
|
|
190
|
+
const future = reactRouterConfig.future;
|
|
174
191
|
return {
|
|
175
192
|
rootDirectory,
|
|
176
193
|
buildDirectory,
|
|
@@ -180,7 +197,8 @@ function resolvePluginConfig(config, options) {
|
|
|
180
197
|
serverEntryPoint,
|
|
181
198
|
dev: options.dev,
|
|
182
199
|
serverBuildFile,
|
|
183
|
-
basename
|
|
200
|
+
basename,
|
|
201
|
+
future
|
|
184
202
|
};
|
|
185
203
|
}
|
|
186
204
|
var warned = false;
|
package/package.json
CHANGED