@vercube/vite 1.1.2 → 1.1.3
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.
|
@@ -30,12 +30,12 @@ function generateServerEntry(ctx) {
|
|
|
30
30
|
lines.push(...imports.values(), "");
|
|
31
31
|
const setupBody = [];
|
|
32
32
|
if (ctx.setupFile) setupBody.push(" await __vercubeSetup__(app);");
|
|
33
|
-
if (ctx.hasClient) setupBody.push(" if (import.meta.main) {", " const dir = fileURLToPath(new URL('./public', import.meta.url));", " app.container.get(HttpServer).addPlugin(serveStaticFiles(dir));", " }");
|
|
34
33
|
if (setupBody.length > 0) lines.push("const app = await createApp({ setup: async (app) => {", ...setupBody, "} });", "");
|
|
35
34
|
else lines.push("const app = await createApp();", "");
|
|
36
35
|
lines.push(...[...imports.keys()].map((name) => `app.container.bind(${name});`), "");
|
|
37
36
|
lines.push("app.container.flushQueue();", "");
|
|
38
|
-
lines.push("if (import.meta.main) {", " await app.listen();", "}", "");
|
|
37
|
+
if (ctx.hasClient) lines.push("if (import.meta.main) {", " const dir = fileURLToPath(new URL('./public', import.meta.url));", " const httpServer = app.container.get(HttpServer);", " httpServer.addPlugin(serveStaticFiles(dir));", " httpServer.enableSpaFallback(dir);", " await app.listen();", "}", "");
|
|
38
|
+
else lines.push("if (import.meta.main) {", " await app.listen();", "}", "");
|
|
39
39
|
lines.push("export const fetch = app.fetch.bind(app);", "");
|
|
40
40
|
lines.push("export const handleUpgrade = (req, socket, head) => globalThis.__vercube_ws_upgrade__?.(req, socket, head);", "");
|
|
41
41
|
return lines.join("\n");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as scanProject } from "./context-
|
|
1
|
+
import { r as scanProject } from "./context-CEnkMbwW.mjs";
|
|
2
2
|
import { t as VERCUBE_ENV } from "./types-Cpd32Lkt.mjs";
|
|
3
3
|
import { createViteHotChannel } from "env-runner/vite";
|
|
4
4
|
import { watch } from "chokidar";
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as setupContext, n as createContext, t as CLIENT_OUT_DIR } from "./context-
|
|
1
|
+
import { i as setupContext, n as createContext, t as CLIENT_OUT_DIR } from "./context-CEnkMbwW.mjs";
|
|
2
2
|
import { t as VERCUBE_ENV } from "./types-Cpd32Lkt.mjs";
|
|
3
3
|
import { defu } from "defu";
|
|
4
4
|
import { dirname, isAbsolute, resolve } from "pathe";
|
|
@@ -61,7 +61,7 @@ function createVercubeEnvironment(ctx) {
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
dev: { createEnvironment: async (envName, envConfig) => {
|
|
64
|
-
const { createFetchableDevEnvironment } = await import("./dev-
|
|
64
|
+
const { createFetchableDevEnvironment } = await import("./dev-Czr9pV4P.mjs");
|
|
65
65
|
const env = createFetchableDevEnvironment(envName, envConfig, getEnvRunner(ctx), ctx.serverEntry);
|
|
66
66
|
(ctx._viteEnvs ??= /* @__PURE__ */ new Map()).set(envName, ctx.serverEntry);
|
|
67
67
|
return env;
|
|
@@ -190,8 +190,8 @@ function vercubeMain(ctx) {
|
|
|
190
190
|
}
|
|
191
191
|
},
|
|
192
192
|
configureServer: async (server) => {
|
|
193
|
-
const { configureViteDevServer } = await import("./dev-
|
|
194
|
-
|
|
193
|
+
const { configureViteDevServer } = await import("./dev-Czr9pV4P.mjs");
|
|
194
|
+
await configureViteDevServer(ctx, server);
|
|
195
195
|
},
|
|
196
196
|
hotUpdate() {
|
|
197
197
|
if (this.environment.name !== "vercube") return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercube/vite",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Vite plugin integrating Vercube with the Vite Environment API",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"pathe": "2.0.3",
|
|
37
37
|
"rou3": "0.8.1",
|
|
38
38
|
"srvx": "0.11.17",
|
|
39
|
-
"@vercube/scan": "1.1.
|
|
39
|
+
"@vercube/scan": "1.1.3"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"vite": "^8.0.0"
|