@mauroandre/velojs 0.0.15 → 0.0.17
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/components.js +27 -19
- package/dist/hooks.js +37 -37
- package/dist/server.js +41 -41
- package/dist/vite.js +19 -18
- package/package.json +1 -1
package/dist/components.js
CHANGED
|
@@ -1,48 +1,56 @@
|
|
|
1
|
-
import { jsx as o, jsxs as p, Fragment as
|
|
2
|
-
import {
|
|
3
|
-
import { __veloUpdatePending as
|
|
4
|
-
function
|
|
1
|
+
import { jsx as o, jsxs as p, Fragment as $ } from "preact/jsx-runtime";
|
|
2
|
+
import { useRouter as v, Link as E } from "wouter-preact";
|
|
3
|
+
import { __veloUpdatePending as y } from "./hooks.js";
|
|
4
|
+
function O({ basePath: e, favicon: t = "/favicon.ico" } = {}) {
|
|
5
5
|
const n = process.env.NODE_ENV !== "production";
|
|
6
6
|
e = e || process.env.STATIC_BASE_URL || (process.env.VELO_STATIC ? "/client" : "");
|
|
7
7
|
const i = t !== !1 && /* @__PURE__ */ o("link", { rel: "icon", href: `${e}${t}`, type: "image/x-icon" });
|
|
8
8
|
if (n)
|
|
9
|
-
return /* @__PURE__ */ p(
|
|
9
|
+
return /* @__PURE__ */ p($, { children: [
|
|
10
10
|
i,
|
|
11
11
|
/* @__PURE__ */ o("script", { type: "module", src: "/@vite/client" }),
|
|
12
12
|
/* @__PURE__ */ o("script", { type: "module", src: "/__velo_client.js" })
|
|
13
13
|
] });
|
|
14
14
|
const r = typeof __VELO_CLIENT_JS__ < "u" ? __VELO_CLIENT_JS__ : "client.js";
|
|
15
|
-
return /* @__PURE__ */ p(
|
|
15
|
+
return /* @__PURE__ */ p($, { children: [
|
|
16
16
|
i,
|
|
17
17
|
/* @__PURE__ */ o("link", { rel: "stylesheet", href: `${e}/${typeof __VELO_CLIENT_CSS__ < "u" ? __VELO_CLIENT_CSS__ : "client.css"}` }),
|
|
18
18
|
/* @__PURE__ */ o("script", { type: "module", src: `${e}/${r}` })
|
|
19
19
|
] });
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function h(e, t) {
|
|
22
22
|
let n = e;
|
|
23
23
|
for (const [i, r] of Object.entries(t))
|
|
24
24
|
n = n.replace(`:${i}`, r);
|
|
25
25
|
return n;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
const c = typeof e != "string",
|
|
29
|
-
if (typeof window < "u" &&
|
|
30
|
-
|
|
27
|
+
function j({ to: e, params: t, search: n, absolute: i, ...r }) {
|
|
28
|
+
const c = typeof e != "string", u = v(), _ = c ? (i ? e.metadata?.fullPath : e.metadata?.path) ?? "/" : e, l = t ? h(_, t) : _, L = c && i ? `~${l}` : l, a = n ? `?${new URLSearchParams(n).toString()}` : "", m = `${L}${a}`;
|
|
29
|
+
if (typeof window < "u" && y.value) {
|
|
30
|
+
let f;
|
|
31
|
+
if (c) {
|
|
32
|
+
const s = e.metadata?.fullPath ?? _;
|
|
33
|
+
f = `${t ? h(s, t) : s}${a}`;
|
|
34
|
+
} else {
|
|
35
|
+
const s = l.replace(/^~/, "");
|
|
36
|
+
f = `${!l.startsWith("~") && u.base ? u.base : ""}${s}${a}`;
|
|
37
|
+
}
|
|
38
|
+
const { onClick: d, ...S } = r;
|
|
31
39
|
return /* @__PURE__ */ o(
|
|
32
40
|
"a",
|
|
33
41
|
{
|
|
34
|
-
href:
|
|
35
|
-
onClick: (
|
|
36
|
-
d && d(
|
|
42
|
+
href: f,
|
|
43
|
+
onClick: (s) => {
|
|
44
|
+
d && d(s), s.defaultPrevented || (s.preventDefault(), window.location.href = f);
|
|
37
45
|
},
|
|
38
|
-
...
|
|
46
|
+
...S
|
|
39
47
|
}
|
|
40
48
|
);
|
|
41
49
|
}
|
|
42
|
-
return /* @__PURE__ */ o(
|
|
50
|
+
return /* @__PURE__ */ o(E, { to: m, ...r });
|
|
43
51
|
}
|
|
44
52
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
j as Link,
|
|
54
|
+
O as Scripts,
|
|
55
|
+
h as substituteParams
|
|
48
56
|
};
|
package/dist/hooks.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { signal as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useLocation as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
1
|
+
import { signal as _, useSignal as d } from "@preact/signals";
|
|
2
|
+
import { useRef as g, useEffect as h } from "preact/hooks";
|
|
3
|
+
import { useLocation as v, useParams as D } from "wouter-preact";
|
|
4
|
+
const p = _(!1);
|
|
5
|
+
function m(e) {
|
|
6
6
|
e.value !== null && typeof e.value == "object" && (e.value = { ...e.value });
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const a =
|
|
8
|
+
function P(e) {
|
|
9
|
+
const a = _(!1);
|
|
10
10
|
if (typeof window > "u")
|
|
11
11
|
return { data: {
|
|
12
12
|
get value() {
|
|
@@ -14,50 +14,50 @@ function T(e) {
|
|
|
14
14
|
}
|
|
15
15
|
}, loading: a };
|
|
16
16
|
const t = window.__PAGE_DATA__, n = e && t?.[e] ? t[e] : null;
|
|
17
|
-
return { data:
|
|
17
|
+
return { data: _(n), loading: a };
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function T(e, a) {
|
|
20
20
|
let t, n;
|
|
21
21
|
Array.isArray(e) ? n = e : (t = e, n = a);
|
|
22
22
|
let r = null;
|
|
23
23
|
if (typeof window > "u" && t) {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const c = globalThis.__veloServerData?.getStore?.();
|
|
25
|
+
c?.[t] && (r = c[t]);
|
|
26
26
|
}
|
|
27
27
|
if (typeof window < "u" && t) {
|
|
28
28
|
const o = window.__PAGE_DATA__;
|
|
29
29
|
o?.[t] && (r = o[t], delete o[t]);
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const u = d(r), i = d(!1), l = () => {
|
|
32
32
|
if (typeof window > "u" || !t) return;
|
|
33
33
|
const o = window.location.pathname;
|
|
34
34
|
i.value = !0;
|
|
35
|
-
const
|
|
35
|
+
const w = typeof __VELO_STATIC__ < "u" && __VELO_STATIC__ ? `${o === "/" ? "" : o}/index.json` : (() => {
|
|
36
36
|
const s = new URLSearchParams(window.location.search);
|
|
37
37
|
return s.set("_data", "1"), `${o}?${s.toString()}`;
|
|
38
|
-
})()
|
|
39
|
-
fetch(
|
|
40
|
-
typeof __VELO_BUILD_HASH__ < "u" && s.__buildHash && s.__buildHash !== __VELO_BUILD_HASH__ && (
|
|
38
|
+
})();
|
|
39
|
+
fetch(w, { cache: "no-cache" }).then((s) => s.json()).then((s) => {
|
|
40
|
+
typeof __VELO_BUILD_HASH__ < "u" && s.__buildHash && s.__buildHash !== __VELO_BUILD_HASH__ && (p.value = !0), u.value = s[t], i.value = !1;
|
|
41
41
|
}).catch(() => {
|
|
42
42
|
i.value = !1;
|
|
43
43
|
});
|
|
44
|
-
},
|
|
45
|
-
return
|
|
46
|
-
if (
|
|
47
|
-
|
|
44
|
+
}, f = g(r !== null);
|
|
45
|
+
return h(() => {
|
|
46
|
+
if (f.current) {
|
|
47
|
+
f.current = !1;
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
}, n ?? []), { data:
|
|
50
|
+
l();
|
|
51
|
+
}, n ?? []), { data: u, loading: i, refetch: l };
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
const [, e] =
|
|
53
|
+
function L() {
|
|
54
|
+
const [, e] = v();
|
|
55
55
|
return e;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return typeof window > "u" ? globalThis.__veloServerData?.getStore?.()?.__params ?? {} :
|
|
57
|
+
function E() {
|
|
58
|
+
return typeof window > "u" ? globalThis.__veloServerData?.getStore?.()?.__params ?? {} : D();
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function b() {
|
|
61
61
|
if (typeof window > "u")
|
|
62
62
|
return globalThis.__veloServerData?.getStore?.()?.__query ?? {};
|
|
63
63
|
const e = window.__PAGE_DATA__;
|
|
@@ -68,16 +68,16 @@ function U() {
|
|
|
68
68
|
t[r] = n;
|
|
69
69
|
}), t;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
return typeof window > "u" ? globalThis.__veloServerData?.getStore?.()?.__pathname ?? "/" : (
|
|
71
|
+
function H() {
|
|
72
|
+
return typeof window > "u" ? globalThis.__veloServerData?.getStore?.()?.__pathname ?? "/" : (v(), window.location.pathname);
|
|
73
73
|
}
|
|
74
74
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
P as Loader,
|
|
76
|
+
p as __veloUpdatePending,
|
|
77
|
+
m as touch,
|
|
78
|
+
T as useLoader,
|
|
79
|
+
L as useNavigate,
|
|
80
|
+
E as useParams,
|
|
81
|
+
H as usePathname,
|
|
82
|
+
b as useQuery
|
|
83
83
|
};
|
package/dist/server.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Hono as
|
|
3
|
-
import { logger as
|
|
4
|
-
import { trimTrailingSlash as
|
|
5
|
-
import { render as
|
|
6
|
-
import { Router as
|
|
7
|
-
import { AsyncLocalStorage as
|
|
8
|
-
const v = new
|
|
1
|
+
import { jsx as m } from "preact/jsx-runtime";
|
|
2
|
+
import { Hono as T } from "hono";
|
|
3
|
+
import { logger as A } from "hono/logger";
|
|
4
|
+
import { trimTrailingSlash as b } from "hono/trailing-slash";
|
|
5
|
+
import { render as D } from "preact-render-to-string";
|
|
6
|
+
import { Router as R } from "wouter-preact";
|
|
7
|
+
import { AsyncLocalStorage as C } from "node:async_hooks";
|
|
8
|
+
const v = new C();
|
|
9
9
|
globalThis.__veloServerData = v;
|
|
10
10
|
const _ = [];
|
|
11
11
|
let p = null;
|
|
12
|
-
function
|
|
12
|
+
function L(t) {
|
|
13
13
|
if (p) {
|
|
14
14
|
t(p);
|
|
15
15
|
return;
|
|
@@ -21,18 +21,18 @@ function y(t) {
|
|
|
21
21
|
for (const e of _) e(t);
|
|
22
22
|
_.length = 0;
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
function
|
|
26
|
-
|
|
24
|
+
const w = [];
|
|
25
|
+
function U(t) {
|
|
26
|
+
w.push(t);
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const N = (t, e, o) => {
|
|
29
29
|
if (t.req.query("_data") === "1") {
|
|
30
|
-
const c =
|
|
30
|
+
const c = globalThis.__veloBuildHash || void 0, r = o ? { ...o, __buildHash: c } : { __buildHash: c };
|
|
31
31
|
return t.json(r);
|
|
32
32
|
}
|
|
33
33
|
const s = t.req.path, n = v.run(
|
|
34
34
|
o ?? {},
|
|
35
|
-
() =>
|
|
35
|
+
() => D(/* @__PURE__ */ m(R, { ssrPath: s, children: e }))
|
|
36
36
|
);
|
|
37
37
|
if (t.header("Cache-Control", "no-cache"), !o)
|
|
38
38
|
return t.html(n);
|
|
@@ -40,7 +40,7 @@ const R = (t, e, o) => {
|
|
|
40
40
|
o
|
|
41
41
|
)}<\/script>`;
|
|
42
42
|
return t.html(n.replace("</head>", `${a}</head>`));
|
|
43
|
-
},
|
|
43
|
+
}, O = async (t, e) => {
|
|
44
44
|
const o = e.req.param(), s = e.req.query(), n = { params: o, query: s, c: e }, a = await Promise.all(
|
|
45
45
|
t.map(async (r) => {
|
|
46
46
|
if (!r.loader) return null;
|
|
@@ -58,24 +58,24 @@ const R = (t, e, o) => {
|
|
|
58
58
|
components: t.map((r) => r.Component),
|
|
59
59
|
data: c
|
|
60
60
|
};
|
|
61
|
-
},
|
|
61
|
+
}, j = (t) => {
|
|
62
62
|
if (t.length === 0) return null;
|
|
63
63
|
const e = t.filter(Boolean);
|
|
64
64
|
if (e.length === 0) return null;
|
|
65
65
|
if (e.length === 1) {
|
|
66
66
|
const n = e[0];
|
|
67
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ m(n, {});
|
|
68
68
|
}
|
|
69
69
|
const o = e[e.length - 1];
|
|
70
|
-
return e.slice(0, -1).reduceRight((n, a) => /* @__PURE__ */
|
|
71
|
-
},
|
|
70
|
+
return e.slice(0, -1).reduceRight((n, a) => /* @__PURE__ */ m(a, { children: n }), /* @__PURE__ */ m(o, {}));
|
|
71
|
+
}, S = (t, e, o = [], s = []) => {
|
|
72
72
|
for (const n of e) {
|
|
73
73
|
const a = [...o, n.module], c = [
|
|
74
74
|
...s,
|
|
75
75
|
...n.middlewares || []
|
|
76
76
|
];
|
|
77
77
|
if (n.children)
|
|
78
|
-
|
|
78
|
+
S(
|
|
79
79
|
t,
|
|
80
80
|
n.children,
|
|
81
81
|
a,
|
|
@@ -90,13 +90,13 @@ const R = (t, e, o) => {
|
|
|
90
90
|
continue;
|
|
91
91
|
}
|
|
92
92
|
const u = async (i) => {
|
|
93
|
-
const { components: d, data: f } = await
|
|
94
|
-
return
|
|
93
|
+
const { components: d, data: f } = await O(a, i), l = j(d);
|
|
94
|
+
return N(i, l, f);
|
|
95
95
|
};
|
|
96
96
|
c.length > 0 ? t.on(["GET"], [r], ...c, u) : t.on(["GET"], [r], u);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
},
|
|
99
|
+
}, q = (t, e, o = []) => {
|
|
100
100
|
for (const s of e) {
|
|
101
101
|
const n = s.module.metadata?.moduleId, a = [
|
|
102
102
|
...o,
|
|
@@ -115,18 +115,18 @@ const R = (t, e, o) => {
|
|
|
115
115
|
g = await l.req.json();
|
|
116
116
|
} catch {
|
|
117
117
|
}
|
|
118
|
-
const
|
|
118
|
+
const E = {
|
|
119
119
|
body: g,
|
|
120
120
|
params: l.req.param(),
|
|
121
121
|
query: l.req.query(),
|
|
122
122
|
c: l
|
|
123
123
|
};
|
|
124
124
|
try {
|
|
125
|
-
const
|
|
126
|
-
return l.json(
|
|
127
|
-
} catch (
|
|
128
|
-
const
|
|
129
|
-
return l.json({ error:
|
|
125
|
+
const h = await i(E);
|
|
126
|
+
return l.json(h ?? { ok: !0 });
|
|
127
|
+
} catch (h) {
|
|
128
|
+
const P = h instanceof Error ? h.message : "Action failed";
|
|
129
|
+
return l.json({ error: P }, 500);
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
132
|
a.length > 0 ? t.on(
|
|
@@ -138,20 +138,20 @@ const R = (t, e, o) => {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
s.children &&
|
|
141
|
+
s.children && q(t, s.children, a);
|
|
142
142
|
}
|
|
143
|
-
},
|
|
144
|
-
const e = new
|
|
145
|
-
e.use(
|
|
146
|
-
for (const o of
|
|
143
|
+
}, I = async (t) => {
|
|
144
|
+
const e = new T();
|
|
145
|
+
e.use(b()), process.env.NODE_ENV !== "production" && e.use("*", A());
|
|
146
|
+
for (const o of w)
|
|
147
147
|
await o(e);
|
|
148
|
-
if (
|
|
148
|
+
if (S(e, t), q(e, t), process.env.NODE_ENV !== "production" && !p) {
|
|
149
149
|
const o = globalThis.__veloDevServer;
|
|
150
150
|
o && y(o);
|
|
151
151
|
}
|
|
152
152
|
return e;
|
|
153
153
|
}, x = async (t) => {
|
|
154
|
-
const { routes: e, port: o = Number(process.env.SERVER_PORT) || 3e3 } = t, s = await
|
|
154
|
+
const { routes: e, port: o = Number(process.env.SERVER_PORT) || 3e3 } = t, s = await I(e);
|
|
155
155
|
if (process.env.NODE_ENV === "production" && !process.env.VELO_STATIC) {
|
|
156
156
|
const { serve: n } = await import("@hono/node-server"), { serveStatic: a } = await import("@hono/node-server/serve-static"), { join: c } = await import("node:path"), r = c(process.cwd(), "dist/client");
|
|
157
157
|
(process.env.STATIC_BASE_URL || "").startsWith("http") || s.use("/*", a({ root: r })), console.log(`Server running on http://localhost:${o}`);
|
|
@@ -161,10 +161,10 @@ const R = (t, e, o) => {
|
|
|
161
161
|
return s;
|
|
162
162
|
};
|
|
163
163
|
export {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
U as addRoutes,
|
|
165
|
+
I as createApp,
|
|
166
|
+
I as default,
|
|
167
|
+
L as onServer,
|
|
168
168
|
v as serverDataStorage,
|
|
169
169
|
x as startServer
|
|
170
170
|
};
|
package/dist/vite.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import d from "node:path";
|
|
2
|
-
import
|
|
2
|
+
import _ from "node:fs";
|
|
3
3
|
import C from "@preact/preset-vite";
|
|
4
4
|
import F from "@hono/vite-dev-server";
|
|
5
5
|
import { parse as v } from "@babel/parser";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import E from "@babel/traverse";
|
|
7
|
+
import b from "@babel/generator";
|
|
8
8
|
import * as e from "@babel/types";
|
|
9
|
-
const m = typeof
|
|
9
|
+
const m = typeof E == "function" ? E : E.default, S = typeof b == "function" ? b : b.default;
|
|
10
10
|
function w(u, c, r, l) {
|
|
11
11
|
const i = v(u, {
|
|
12
12
|
sourceType: "module",
|
|
@@ -241,7 +241,7 @@ function k(u) {
|
|
|
241
241
|
}
|
|
242
242
|
}), S(c, { retainLines: !0 }).code);
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function j(u) {
|
|
245
245
|
const c = v(u, {
|
|
246
246
|
sourceType: "module",
|
|
247
247
|
plugins: ["typescript", "jsx"]
|
|
@@ -291,7 +291,7 @@ function A(u, c, r) {
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
const g = "virtual:velo/server-entry", x = "virtual:velo/client-entry", T = "\0" + g, P = "\0" + x;
|
|
294
|
-
function
|
|
294
|
+
function B(u, c) {
|
|
295
295
|
let r = d.resolve(process.cwd(), c);
|
|
296
296
|
const l = u.routesFile ?? "routes.tsx", i = /* @__PURE__ */ new Map();
|
|
297
297
|
return {
|
|
@@ -302,8 +302,8 @@ function J(u, c) {
|
|
|
302
302
|
},
|
|
303
303
|
buildStart() {
|
|
304
304
|
const t = d.join(r, l);
|
|
305
|
-
if (
|
|
306
|
-
const n =
|
|
305
|
+
if (_.existsSync(t)) {
|
|
306
|
+
const n = _.readFileSync(t, "utf-8"), s = j(n);
|
|
307
307
|
i.clear();
|
|
308
308
|
for (const [o, a] of s)
|
|
309
309
|
i.set(o, a);
|
|
@@ -312,7 +312,7 @@ function J(u, c) {
|
|
|
312
312
|
handleHotUpdate({ file: t, server: n }) {
|
|
313
313
|
const s = d.join(r, l);
|
|
314
314
|
if (t === s) {
|
|
315
|
-
const o =
|
|
315
|
+
const o = _.readFileSync(s, "utf-8"), a = j(o);
|
|
316
316
|
i.clear();
|
|
317
317
|
for (const [p, f] of a)
|
|
318
318
|
i.set(p, f);
|
|
@@ -325,6 +325,7 @@ function J(u, c) {
|
|
|
325
325
|
load(t) {
|
|
326
326
|
const n = u.routesFile ?? "routes.tsx", s = u.serverInit ?? "server.tsx", o = u.clientInit ?? "client.tsx", a = d.join(r, n).replace(/\.tsx?$/, ".js"), p = d.join(r, s).replace(/\.tsx?$/, ".js"), f = d.join(r, o).replace(/\.tsx?$/, ".js");
|
|
327
327
|
return t === T ? `
|
|
328
|
+
globalThis.__veloBuildHash = __VELO_BUILD_HASH__;
|
|
328
329
|
import "${p}";
|
|
329
330
|
import routes from "${a}";
|
|
330
331
|
import { startServer } from "@mauroandre/velojs/server";
|
|
@@ -347,10 +348,10 @@ startClient({ routes });
|
|
|
347
348
|
t
|
|
348
349
|
), y = /export\s+(const|function)\s+loader/.test(t), N = /export\s+const\s+action_\w+/.test(t), O = /\bLoader\s*</.test(t) || /\bLoader\s*\(/.test(t), D = /\buseLoader\s*</.test(t) || /\buseLoader\s*\(/.test(t);
|
|
349
350
|
if (!o && f && (a = k(a), p = !0), h || y || N || O || D) {
|
|
350
|
-
const
|
|
351
|
-
a = w(a,
|
|
351
|
+
const L = d.relative(r, n).replace(/\.(tsx?|jsx?)$/, "").replace(/\\/g, "/"), I = i.get(L);
|
|
352
|
+
a = w(a, L, I?.fullPath, I?.path), a = R(a, L), o || (a = V(
|
|
352
353
|
a,
|
|
353
|
-
|
|
354
|
+
L
|
|
354
355
|
)), o || (a = $(a)), p = !0;
|
|
355
356
|
}
|
|
356
357
|
return p ? {
|
|
@@ -360,7 +361,7 @@ startClient({ routes });
|
|
|
360
361
|
}
|
|
361
362
|
};
|
|
362
363
|
}
|
|
363
|
-
function
|
|
364
|
+
function J() {
|
|
364
365
|
return {
|
|
365
366
|
name: "velo:config",
|
|
366
367
|
config(u, { mode: c }) {
|
|
@@ -368,7 +369,7 @@ function M() {
|
|
|
368
369
|
let t = "client.js", n = "client.css";
|
|
369
370
|
if (r)
|
|
370
371
|
try {
|
|
371
|
-
const o = d.resolve(process.cwd(), "dist/client/.vite/manifest.json"), p = JSON.parse(
|
|
372
|
+
const o = d.resolve(process.cwd(), "dist/client/.vite/manifest.json"), p = JSON.parse(_.readFileSync(o, "utf-8"))[x];
|
|
372
373
|
p && (t = p.file || t, p.css?.[0] && (n = p.css[0]));
|
|
373
374
|
} catch {
|
|
374
375
|
}
|
|
@@ -412,7 +413,7 @@ function M() {
|
|
|
412
413
|
}
|
|
413
414
|
};
|
|
414
415
|
}
|
|
415
|
-
function
|
|
416
|
+
function M() {
|
|
416
417
|
return {
|
|
417
418
|
name: "velo:static-url",
|
|
418
419
|
apply: "build",
|
|
@@ -431,9 +432,9 @@ function B() {
|
|
|
431
432
|
function Z(u) {
|
|
432
433
|
const c = u ?? {}, r = c.appDirectory ?? "./app";
|
|
433
434
|
return [
|
|
435
|
+
J(),
|
|
436
|
+
B(c, r),
|
|
434
437
|
M(),
|
|
435
|
-
J(c, r),
|
|
436
|
-
B(),
|
|
437
438
|
C(),
|
|
438
439
|
F({
|
|
439
440
|
entry: g
|
|
@@ -450,7 +451,7 @@ function H() {
|
|
|
450
451
|
};
|
|
451
452
|
}
|
|
452
453
|
export {
|
|
453
|
-
|
|
454
|
+
j as buildFullPathMap,
|
|
454
455
|
A as collectFullPaths,
|
|
455
456
|
w as injectMetadata,
|
|
456
457
|
$ as removeLoaders,
|