vike-lite 1.15.4 → 1.15.5

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 +11 -8
  2. package/package.json +1 -1
package/dist/vite.mjs CHANGED
@@ -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.5",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",