vike-lite 1.0.11 → 1.0.13

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/server.mjs CHANGED
@@ -13,7 +13,6 @@ var AbortRender = class extends Error {
13
13
  //#endregion
14
14
  //#region src/server/renderPage.tsx
15
15
  const isProd = process.env.NODE_ENV === "production";
16
- const virtualEntryClientId = "virtual:entry-client";
17
16
  const ESCAPE_LOOKUP = {
18
17
  "&": String.raw`\u0026`,
19
18
  ">": String.raw`\u003e`,
@@ -34,6 +33,10 @@ function getAssets(pageModuleId) {
34
33
  const cssFiles = /* @__PURE__ */ new Set();
35
34
  const jsFiles = /* @__PURE__ */ new Set();
36
35
  const manifest = store.manifest;
36
+ function getVirtualEntryClientIdFromManifest() {
37
+ for (const key in manifest) if (manifest[key].isEntry) return key;
38
+ throw new Error("virtual:entry-client not found in manifest");
39
+ }
37
40
  function collectAssets(key) {
38
41
  const chunk = manifest[key];
39
42
  if (!chunk) throw new Error(`Asset not found in manifest for key: ${key}`);
@@ -41,6 +44,7 @@ function getAssets(pageModuleId) {
41
44
  if (chunk.css) for (const css of chunk.css) cssFiles.add(css);
42
45
  if (chunk.imports) for (const imp of chunk.imports) collectAssets(imp);
43
46
  }
47
+ const virtualEntryClientId = getVirtualEntryClientIdFromManifest();
44
48
  collectAssets(virtualEntryClientId);
45
49
  collectAssets(pageModuleId.replace("@/", ""));
46
50
  return {
package/dist/vite.mjs CHANGED
@@ -191,7 +191,9 @@ function routerPlugin({ pagesDir = "pages", serverEntry = "server/index.ts", api
191
191
  `;
192
192
  if (id === resolvedVirtualEntryServerId) {
193
193
  const normalizedServerEntry = path.join(viteConfigRoot, serverEntry).replaceAll("\\", "/");
194
- return `import '${virtualSetupId}';\n${fs.readFileSync(normalizedServerEntry, "utf8")}`;
194
+ return `import '${virtualSetupId}';
195
+ export * from '${normalizedServerEntry}'
196
+ export { default } from '${normalizedServerEntry}'`;
195
197
  }
196
198
  },
197
199
  configureServer(server) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike-lite",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.mjs",