vike-lite 1.0.7 → 1.0.9

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 +8 -3
  2. package/package.json +1 -1
package/dist/vite.mjs CHANGED
@@ -86,10 +86,12 @@ function routerPlugin({ pagesDir = "pages", serverEntry = "server/index.ts", api
86
86
  const virtualAdapterId = "virtual:vike-lite-solid";
87
87
  const virtualEntryClientId = "virtual:entry-client";
88
88
  const virtualSetupId = "virtual:vike-lite/setup";
89
+ const virtualEntryServerId = "virtual:entry-server";
89
90
  const resolvedVirtualModuleId = "\0virtual:routes";
90
91
  const resolvedVirtualManifestId = "\0virtual:client-manifest";
91
92
  const resolvedVirtualEntryClientId = "\0virtual:entry-client";
92
93
  const resolvedVirtualSetupId = "\0virtual:vike-lite/setup";
94
+ const resolvedVirtualEntryServerId = "\0virtual:entry-server";
93
95
  return {
94
96
  name: "vike-lite",
95
97
  config() {
@@ -119,7 +121,7 @@ function routerPlugin({ pagesDir = "pages", serverEntry = "server/index.ts", api
119
121
  outDir: "../dist/server",
120
122
  emptyOutDir: true,
121
123
  rolldownOptions: {
122
- input: serverEntry,
124
+ input: virtualEntryServerId,
123
125
  output: {
124
126
  format: "esm",
125
127
  entryFileNames: "index.mjs",
@@ -141,6 +143,7 @@ function routerPlugin({ pagesDir = "pages", serverEntry = "server/index.ts", api
141
143
  if (id === virtualManifestId) return resolvedVirtualManifestId;
142
144
  if (id === virtualEntryClientId) return resolvedVirtualEntryClientId;
143
145
  if (id === virtualSetupId) return resolvedVirtualSetupId;
146
+ if (id === virtualEntryServerId) return resolvedVirtualEntryServerId;
144
147
  },
145
148
  async load(id, options) {
146
149
  if (id === resolvedVirtualModuleId) {
@@ -180,13 +183,15 @@ function routerPlugin({ pagesDir = "pages", serverEntry = "server/index.ts", api
180
183
  if (id === resolvedVirtualSetupId) return `
181
184
  import { routes, errorRoute, config } from '${virtualModuleId}';
182
185
  import { setVikeState } from 'vike-lite/__internal/server';
183
-
184
186
  let manifest;
185
187
  if (process.env.NODE_ENV === 'production') {
186
188
  manifest = (await import('${virtualManifestId}')).default;
187
189
  }
188
-
189
190
  setVikeState({ routes, errorRoute, config, manifest });
191
+ `;
192
+ if (id === resolvedVirtualEntryServerId) return `
193
+ import '${virtualSetupId}';
194
+ export { default } from '${path.join(viteConfigRoot, serverEntry)}';
190
195
  `;
191
196
  },
192
197
  configureServer(server) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike-lite",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.mjs",