vike-lite 1.15.4 → 1.15.6

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.
Files changed (2) hide show
  1. package/dist/vite.mjs +12 -9
  2. package/package.json +2 -2
package/dist/vite.mjs CHANGED
@@ -253,7 +253,7 @@ function vikeLite({ pagesDir = "pages", apiPrefix = "/api", prerender = false, s
253
253
  const manifestPath = path.join(viteConfigRoot, outDir, "client/.vite/manifest.json");
254
254
  return `export default ${fs.readFileSync(manifestPath, "utf8")}`;
255
255
  }
256
- if (id === RESOLVED.entryClient) return `import{routes,errorRoute}from'${VIRTUAL.routes}';import{onRenderClient}from'${VIRTUAL.client}';await(await onRenderClient()).default({routes,errorRoute});`;
256
+ if (id === RESOLVED.entryClient) return `import{routes,errorRoute}from'${VIRTUAL.routes}';import{onRenderClient}from'${VIRTUAL.client}';await onRenderClient({routes,errorRoute});`;
257
257
  if (id === RESOLVED.setup) {
258
258
  const manifestContent = isProd ? `(await import('${VIRTUAL.manifest}')).default` : "null";
259
259
  return `import{routes,errorRoute,config}from'${VIRTUAL.routes}';import{setVikeState}from'vike-lite/__internal/server';const manifest=${manifestContent};setVikeState({routes,errorRoute,config,manifest});`;
@@ -261,18 +261,21 @@ function vikeLite({ pagesDir = "pages", apiPrefix = "/api", prerender = false, s
261
261
  if (id === RESOLVED.entryServer) {
262
262
  if (serverEntry) {
263
263
  const basePath = path.join(viteConfigRoot, serverEntry);
264
+ const extensions = [
265
+ "",
266
+ ".ts",
267
+ ".js",
268
+ ".mjs"
269
+ ];
264
270
  let serverEntryPath = "";
265
- if (!fs.existsSync(basePath)) {
266
- for (const ext of [
267
- ".ts",
268
- ".js",
269
- ".mjs"
270
- ]) if (fs.existsSync(basePath + ext)) {
271
- serverEntryPath = basePath + ext;
271
+ for (const ext of extensions) {
272
+ const fullPath = basePath + ext;
273
+ if (fs.existsSync(fullPath)) {
274
+ serverEntryPath = fullPath;
272
275
  break;
273
276
  }
274
- if (!serverEntryPath) throw new Error(`[vike-lite] serverEntry ${serverEntry} file not found`);
275
277
  }
278
+ if (!serverEntryPath) throw new Error(`[vike-lite] serverEntry '${serverEntry}' file not found`);
276
279
  serverEntryPath = serverEntryPath.replaceAll("\\", "/");
277
280
  return importSetup + `export*from'${serverEntryPath}';export{default}from'${serverEntryPath}';`;
278
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike-lite",
3
- "version": "1.15.4",
3
+ "version": "1.15.6",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -75,7 +75,7 @@
75
75
  "devDependencies": {
76
76
  "@types/node": "^26.1.1",
77
77
  "tsdown": "^0.22.8",
78
- "vite": "^8.1.4"
78
+ "vite": "^8.1.5"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "vite": ">=8"