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.
- package/dist/vite.mjs +11 -8
- 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
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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
|
}
|