vike-lite 1.0.9 → 1.0.10

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 +5 -4
  2. package/package.json +1 -1
package/dist/vite.mjs CHANGED
@@ -2,6 +2,7 @@ import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { Readable } from "node:stream";
4
4
  import { pipeline } from "node:stream/promises";
5
+ import { normalizePath } from "vite";
5
6
  //#region src/vite-plugin.ts
6
7
  function generateRoutes(pagesAbsPath) {
7
8
  if (!fs.existsSync(pagesAbsPath)) return { routes: [] };
@@ -189,10 +190,10 @@ function routerPlugin({ pagesDir = "pages", serverEntry = "server/index.ts", api
189
190
  }
190
191
  setVikeState({ routes, errorRoute, config, manifest });
191
192
  `;
192
- if (id === resolvedVirtualEntryServerId) return `
193
- import '${virtualSetupId}';
194
- export { default } from '${path.join(viteConfigRoot, serverEntry)}';
195
- `;
193
+ if (id === resolvedVirtualEntryServerId) {
194
+ const normalizedServerEntry = normalizePath(path.join(viteConfigRoot, serverEntry));
195
+ return `import '${virtualSetupId}';\n${fs.readFileSync(normalizedServerEntry, "utf8")}`;
196
+ }
196
197
  },
197
198
  configureServer(server) {
198
199
  return () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike-lite",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.mjs",