We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adfca63 commit 30e0301Copy full SHA for 30e0301
src/ssr-plugin.ts
@@ -254,6 +254,13 @@ async function renderComponentToSSR(
254
): Promise<{ html: string }> {
255
const viteServer = ctx.project.vite;
256
257
+ // vite doesn't replace import.meta.env with hardcoded values so we need to do it manually
258
+ for (const [key, value] of Object.entries(viteServer.config.env)) {
259
+ // biome-ignore lint/style/noNonNullAssertion: it's always defined
260
+ viteServer.config.define![`__vite_ssr_import_meta__.env.${key}`] =
261
+ JSON.stringify(value);
262
+ }
263
+
264
const qwikModule = await viteServer.ssrLoadModule("@builder.io/qwik");
265
const { jsx } = qwikModule;
266
const jsxElement = jsx(Component, props);
0 commit comments