@qwik.dev/router 2.0.0-alpha.8 → 2.0.0-beta.1
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/README.md +1 -1
- package/lib/adapters/azure-swa/vite/index.cjs +3 -3
- package/lib/adapters/azure-swa/vite/index.d.ts +13 -13
- package/lib/adapters/bun-server/vite/index.cjs +3 -3
- package/lib/adapters/bun-server/vite/index.d.ts +14 -14
- package/lib/adapters/cloud-run/vite/index.cjs +3 -3
- package/lib/adapters/cloud-run/vite/index.d.ts +13 -13
- package/lib/adapters/cloudflare-pages/vite/index.cjs +3 -3
- package/lib/adapters/cloudflare-pages/vite/index.d.ts +27 -27
- package/lib/adapters/deno-server/vite/index.cjs +3 -3
- package/lib/adapters/deno-server/vite/index.d.ts +14 -14
- package/lib/adapters/netlify-edge/vite/index.cjs +3 -3
- package/lib/adapters/netlify-edge/vite/index.d.ts +44 -44
- package/lib/adapters/node-server/vite/index.cjs +3 -3
- package/lib/adapters/node-server/vite/index.d.ts +14 -14
- package/lib/adapters/shared/vite/index.cjs +10 -3
- package/lib/adapters/shared/vite/index.d.ts +114 -114
- package/lib/adapters/shared/vite/index.mjs +7 -0
- package/lib/adapters/static/vite/index.cjs +10 -3
- package/lib/adapters/static/vite/index.d.ts +10 -10
- package/lib/adapters/static/vite/index.mjs +7 -0
- package/lib/adapters/vercel-edge/vite/index.cjs +3 -3
- package/lib/adapters/vercel-edge/vite/index.d.ts +45 -45
- package/lib/index.d.ts +878 -801
- package/lib/index.qwik.cjs +127 -51
- package/lib/index.qwik.mjs +130 -54
- package/lib/middleware/aws-lambda/index.d.ts +48 -50
- package/lib/middleware/azure-swa/index.d.ts +28 -28
- package/lib/middleware/bun/index.d.ts +35 -35
- package/lib/middleware/cloudflare-pages/index.d.ts +35 -35
- package/lib/middleware/deno/index.d.ts +47 -47
- package/lib/middleware/firebase/index.d.ts +26 -26
- package/lib/middleware/netlify-edge/index.d.ts +27 -27
- package/lib/middleware/node/index.cjs +3 -3
- package/lib/middleware/node/index.d.ts +64 -66
- package/lib/middleware/request-handler/index.cjs +133 -75
- package/lib/middleware/request-handler/index.d.ts +710 -681
- package/lib/middleware/request-handler/index.mjs +129 -72
- package/lib/middleware/vercel-edge/index.d.ts +26 -26
- package/lib/service-worker.cjs +13 -263
- package/lib/service-worker.d.ts +15 -4
- package/lib/service-worker.mjs +13 -263
- package/lib/static/index.cjs +3 -3
- package/lib/static/index.d.ts +96 -98
- package/lib/static/node.cjs +3 -3
- package/lib/vite/index.cjs +199 -262
- package/lib/vite/index.d.ts +154 -154
- package/lib/vite/index.mjs +197 -260
- package/package.json +8 -8
package/lib/vite/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
7
7
|
var __esm = (fn, res) => function __init() {
|
|
8
8
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
9
|
};
|
|
10
|
-
var __commonJS = (cb, mod) => function
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
11
11
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
12
|
};
|
|
13
13
|
var __export = (target, all3) => {
|
|
@@ -14285,7 +14285,7 @@ function extendConfig(baseConfigExport, serverConfigExport) {
|
|
|
14285
14285
|
}
|
|
14286
14286
|
|
|
14287
14287
|
// sw-reg:@qwik-router-sw-register-build
|
|
14288
|
-
var qwik_router_sw_register_build_default = '
|
|
14288
|
+
var qwik_router_sw_register_build_default = '"serviceWorker"in navigator?navigator.serviceWorker.register("__url").catch(r=>console.error(r)):console.log("Service worker not supported in this browser.")';
|
|
14289
14289
|
|
|
14290
14290
|
// packages/qwik-router/src/buildtime/vite/plugin.ts
|
|
14291
14291
|
import fs8 from "node:fs";
|
|
@@ -14295,17 +14295,11 @@ import { loadEnv } from "vite";
|
|
|
14295
14295
|
// packages/qwik-router/src/middleware/request-handler/error-handler.ts
|
|
14296
14296
|
var ServerError = class extends Error {
|
|
14297
14297
|
constructor(status, data) {
|
|
14298
|
-
super();
|
|
14298
|
+
super(typeof data === "string" ? data : void 0);
|
|
14299
14299
|
this.status = status;
|
|
14300
14300
|
this.data = data;
|
|
14301
14301
|
}
|
|
14302
14302
|
};
|
|
14303
|
-
var ErrorResponse = class extends Error {
|
|
14304
|
-
constructor(status, message) {
|
|
14305
|
-
super(message);
|
|
14306
|
-
this.status = status;
|
|
14307
|
-
}
|
|
14308
|
-
};
|
|
14309
14303
|
function getErrorHtml(status, e) {
|
|
14310
14304
|
let message = "Server Error";
|
|
14311
14305
|
if (e != null) {
|
|
@@ -14507,6 +14501,14 @@ var AbortMessage = class {
|
|
|
14507
14501
|
var RedirectMessage = class extends AbortMessage {
|
|
14508
14502
|
};
|
|
14509
14503
|
|
|
14504
|
+
// packages/qwik-router/src/middleware/request-handler/rewrite-handler.ts
|
|
14505
|
+
var RewriteMessage = class extends AbortMessage {
|
|
14506
|
+
constructor(pathname) {
|
|
14507
|
+
super();
|
|
14508
|
+
this.pathname = pathname;
|
|
14509
|
+
}
|
|
14510
|
+
};
|
|
14511
|
+
|
|
14510
14512
|
// packages/qwik-router/src/runtime/src/constants.ts
|
|
14511
14513
|
var QACTION_KEY = "qaction";
|
|
14512
14514
|
var QFN_KEY = "qfunc";
|
|
@@ -14670,8 +14672,7 @@ function createCacheControl(cacheControl) {
|
|
|
14670
14672
|
cacheControl = {
|
|
14671
14673
|
public: true,
|
|
14672
14674
|
immutable: true,
|
|
14673
|
-
maxAge: 60 * 60 * 24 * 365
|
|
14674
|
-
staleWhileRevalidate: 60 * 60 * 24 * 365
|
|
14675
|
+
maxAge: 60 * 60 * 24 * 365
|
|
14675
14676
|
};
|
|
14676
14677
|
} else if (cacheControl === "no-cache") {
|
|
14677
14678
|
cacheControl = {
|
|
@@ -14681,8 +14682,7 @@ function createCacheControl(cacheControl) {
|
|
|
14681
14682
|
if (typeof cacheControl === "number") {
|
|
14682
14683
|
cacheControl = {
|
|
14683
14684
|
maxAge: cacheControl,
|
|
14684
|
-
sMaxAge: cacheControl
|
|
14685
|
-
staleWhileRevalidate: cacheControl
|
|
14685
|
+
sMaxAge: cacheControl
|
|
14686
14686
|
};
|
|
14687
14687
|
}
|
|
14688
14688
|
if (cacheControl.immutable) {
|
|
@@ -14727,14 +14727,13 @@ import("node:async_hooks").then((module) => {
|
|
|
14727
14727
|
err
|
|
14728
14728
|
);
|
|
14729
14729
|
});
|
|
14730
|
-
function runQwikRouter(serverRequestEv, loadedRoute, requestHandlers,
|
|
14730
|
+
function runQwikRouter(serverRequestEv, loadedRoute, requestHandlers, rebuildRouteInfo, trailingSlash = true, basePathname = "/", qwikSerializer) {
|
|
14731
14731
|
let resolve4;
|
|
14732
14732
|
const responsePromise = new Promise((r2) => resolve4 = r2);
|
|
14733
14733
|
const requestEv = createRequestEvent(
|
|
14734
14734
|
serverRequestEv,
|
|
14735
14735
|
loadedRoute,
|
|
14736
14736
|
requestHandlers,
|
|
14737
|
-
manifest,
|
|
14738
14737
|
trailingSlash,
|
|
14739
14738
|
basePathname,
|
|
14740
14739
|
qwikSerializer,
|
|
@@ -14743,49 +14742,71 @@ function runQwikRouter(serverRequestEv, loadedRoute, requestHandlers, manifest,
|
|
|
14743
14742
|
return {
|
|
14744
14743
|
response: responsePromise,
|
|
14745
14744
|
requestEv,
|
|
14746
|
-
completion: asyncStore ? asyncStore.run(requestEv, runNext, requestEv, resolve4) : runNext(requestEv, resolve4)
|
|
14745
|
+
completion: asyncStore ? asyncStore.run(requestEv, runNext, requestEv, rebuildRouteInfo, resolve4) : runNext(requestEv, rebuildRouteInfo, resolve4)
|
|
14747
14746
|
};
|
|
14748
14747
|
}
|
|
14749
|
-
async function runNext(requestEv, resolve4) {
|
|
14750
|
-
|
|
14751
|
-
|
|
14752
|
-
|
|
14753
|
-
|
|
14754
|
-
|
|
14755
|
-
|
|
14756
|
-
|
|
14757
|
-
|
|
14758
|
-
if (
|
|
14759
|
-
|
|
14760
|
-
|
|
14761
|
-
|
|
14762
|
-
|
|
14763
|
-
|
|
14764
|
-
|
|
14765
|
-
|
|
14766
|
-
|
|
14767
|
-
|
|
14768
|
-
|
|
14769
|
-
|
|
14748
|
+
async function runNext(requestEv, rebuildRouteInfo, resolve4) {
|
|
14749
|
+
let rewriteAttempt = 1;
|
|
14750
|
+
async function _runNext() {
|
|
14751
|
+
try {
|
|
14752
|
+
await requestEv.next();
|
|
14753
|
+
} catch (e) {
|
|
14754
|
+
if (e instanceof RedirectMessage) {
|
|
14755
|
+
const stream = requestEv.getWritableStream();
|
|
14756
|
+
await stream.close();
|
|
14757
|
+
} else if (e instanceof RewriteMessage) {
|
|
14758
|
+
if (rewriteAttempt > 50) {
|
|
14759
|
+
throw new Error(`Infinite rewrite loop`);
|
|
14760
|
+
}
|
|
14761
|
+
rewriteAttempt += 1;
|
|
14762
|
+
const url = new URL(requestEv.url);
|
|
14763
|
+
url.pathname = e.pathname;
|
|
14764
|
+
const { loadedRoute, requestHandlers } = await rebuildRouteInfo(url);
|
|
14765
|
+
requestEv.resetRoute(loadedRoute, requestHandlers, url);
|
|
14766
|
+
return await _runNext();
|
|
14767
|
+
} else if (e instanceof ServerError) {
|
|
14768
|
+
if (!requestEv.headersSent) {
|
|
14769
|
+
const status = e.status;
|
|
14770
|
+
const accept = requestEv.request.headers.get("Accept");
|
|
14771
|
+
if (accept && !accept.includes("text/html")) {
|
|
14772
|
+
const qwikSerializer = requestEv[RequestEvQwikSerializer];
|
|
14773
|
+
requestEv.headers.set("Content-Type", "application/qwik-json");
|
|
14774
|
+
requestEv.send(status, await qwikSerializer._serialize([e.data]));
|
|
14775
|
+
} else {
|
|
14776
|
+
const html5 = getErrorHtml(e.status, e.data);
|
|
14777
|
+
requestEv.html(status, html5);
|
|
14770
14778
|
}
|
|
14771
|
-
|
|
14772
|
-
|
|
14773
|
-
|
|
14774
|
-
|
|
14775
|
-
|
|
14779
|
+
}
|
|
14780
|
+
} else if (!(e instanceof AbortMessage)) {
|
|
14781
|
+
if (getRequestMode(requestEv) !== "dev") {
|
|
14782
|
+
try {
|
|
14783
|
+
if (!requestEv.headersSent) {
|
|
14784
|
+
requestEv.headers.set("content-type", "text/html; charset=utf-8");
|
|
14785
|
+
requestEv.cacheControl({ noCache: true });
|
|
14786
|
+
requestEv.status(500);
|
|
14787
|
+
}
|
|
14788
|
+
const stream = requestEv.getWritableStream();
|
|
14789
|
+
if (!stream.locked) {
|
|
14790
|
+
const writer = stream.getWriter();
|
|
14791
|
+
await writer.write(encoder.encode(minimalHtmlResponse(500, "Internal Server Error")));
|
|
14792
|
+
await writer.close();
|
|
14793
|
+
}
|
|
14794
|
+
} catch {
|
|
14795
|
+
console.error("Unable to render error page");
|
|
14776
14796
|
}
|
|
14777
|
-
} catch {
|
|
14778
|
-
console.error("Unable to render error page");
|
|
14779
14797
|
}
|
|
14798
|
+
return e;
|
|
14780
14799
|
}
|
|
14781
|
-
return e;
|
|
14782
14800
|
}
|
|
14801
|
+
return void 0;
|
|
14802
|
+
}
|
|
14803
|
+
try {
|
|
14804
|
+
return await _runNext();
|
|
14783
14805
|
} finally {
|
|
14784
14806
|
if (!requestEv.isDirty()) {
|
|
14785
14807
|
resolve4(null);
|
|
14786
14808
|
}
|
|
14787
14809
|
}
|
|
14788
|
-
return void 0;
|
|
14789
14810
|
}
|
|
14790
14811
|
function getRouteMatchPathname(pathname, trailingSlash) {
|
|
14791
14812
|
if (pathname.endsWith(QDATA_JSON)) {
|
|
@@ -14811,7 +14832,8 @@ var RequestRouteName = "@routeName";
|
|
|
14811
14832
|
var RequestEvSharedActionId = "@actionId";
|
|
14812
14833
|
var RequestEvSharedActionFormData = "@actionFormData";
|
|
14813
14834
|
var RequestEvSharedNonce = "@nonce";
|
|
14814
|
-
|
|
14835
|
+
var RequestEvIsRewrite = "@rewrite";
|
|
14836
|
+
function createRequestEvent(serverRequestEv, loadedRoute, requestHandlers, trailingSlash, basePathname, qwikSerializer, resolved) {
|
|
14815
14837
|
const { request, platform, env: env2 } = serverRequestEv;
|
|
14816
14838
|
const sharedMap = /* @__PURE__ */ new Map();
|
|
14817
14839
|
const cookie = new Cookie(request.headers.get("cookie"));
|
|
@@ -14824,7 +14846,6 @@ function createRequestEvent(serverRequestEv, loadedRoute, requestHandlers, manif
|
|
|
14824
14846
|
}
|
|
14825
14847
|
sharedMap.set(IsQData, true);
|
|
14826
14848
|
}
|
|
14827
|
-
sharedMap.set("@manifest", manifest);
|
|
14828
14849
|
let routeModuleIndex = -1;
|
|
14829
14850
|
let writableStream = null;
|
|
14830
14851
|
let requestData = void 0;
|
|
@@ -14842,6 +14863,13 @@ function createRequestEvent(serverRequestEv, loadedRoute, requestHandlers, manif
|
|
|
14842
14863
|
routeModuleIndex++;
|
|
14843
14864
|
}
|
|
14844
14865
|
};
|
|
14866
|
+
const resetRoute = (_loadedRoute, _requestHandlers, _url = url) => {
|
|
14867
|
+
loadedRoute = _loadedRoute;
|
|
14868
|
+
requestHandlers = _requestHandlers;
|
|
14869
|
+
url.pathname = _url.pathname;
|
|
14870
|
+
url.search = _url.search;
|
|
14871
|
+
routeModuleIndex = -1;
|
|
14872
|
+
};
|
|
14845
14873
|
const check = () => {
|
|
14846
14874
|
if (writableStream !== null) {
|
|
14847
14875
|
throw new Error("Response already sent");
|
|
@@ -14876,11 +14904,7 @@ function createRequestEvent(serverRequestEv, loadedRoute, requestHandlers, manif
|
|
|
14876
14904
|
const writableStream2 = requestEv.getWritableStream();
|
|
14877
14905
|
statusOrResponse.body.pipeTo(writableStream2);
|
|
14878
14906
|
} else {
|
|
14879
|
-
|
|
14880
|
-
return new RedirectMessage();
|
|
14881
|
-
} else {
|
|
14882
|
-
requestEv.getWritableStream().getWriter().close();
|
|
14883
|
-
}
|
|
14907
|
+
requestEv.getWritableStream().getWriter().close();
|
|
14884
14908
|
}
|
|
14885
14909
|
}
|
|
14886
14910
|
return exit2();
|
|
@@ -14894,17 +14918,26 @@ function createRequestEvent(serverRequestEv, loadedRoute, requestHandlers, manif
|
|
|
14894
14918
|
[RequestEvLoaders]: loaders,
|
|
14895
14919
|
[RequestEvMode]: serverRequestEv.mode,
|
|
14896
14920
|
[RequestEvTrailingSlash]: trailingSlash,
|
|
14897
|
-
[RequestEvRoute]
|
|
14921
|
+
get [RequestEvRoute]() {
|
|
14922
|
+
return loadedRoute;
|
|
14923
|
+
},
|
|
14898
14924
|
[RequestEvQwikSerializer]: qwikSerializer,
|
|
14899
14925
|
cookie,
|
|
14900
14926
|
headers,
|
|
14901
14927
|
env: env2,
|
|
14902
14928
|
method: request.method,
|
|
14903
14929
|
signal: request.signal,
|
|
14904
|
-
|
|
14905
|
-
|
|
14930
|
+
originalUrl: new URL(url),
|
|
14931
|
+
get params() {
|
|
14932
|
+
return (loadedRoute == null ? void 0 : loadedRoute[1]) ?? {};
|
|
14933
|
+
},
|
|
14934
|
+
get pathname() {
|
|
14935
|
+
return url.pathname;
|
|
14936
|
+
},
|
|
14906
14937
|
platform,
|
|
14907
|
-
query
|
|
14938
|
+
get query() {
|
|
14939
|
+
return url.searchParams;
|
|
14940
|
+
},
|
|
14908
14941
|
request,
|
|
14909
14942
|
url,
|
|
14910
14943
|
basePathname,
|
|
@@ -14919,6 +14952,7 @@ function createRequestEvent(serverRequestEv, loadedRoute, requestHandlers, manif
|
|
|
14919
14952
|
return serverRequestEv.getClientConn();
|
|
14920
14953
|
},
|
|
14921
14954
|
next,
|
|
14955
|
+
resetRoute,
|
|
14922
14956
|
exit: exit2,
|
|
14923
14957
|
cacheControl: (cacheControl, target = "Cache-Control") => {
|
|
14924
14958
|
check();
|
|
@@ -14951,7 +14985,7 @@ function createRequestEvent(serverRequestEv, loadedRoute, requestHandlers, manif
|
|
|
14951
14985
|
},
|
|
14952
14986
|
error: (statusCode, message) => {
|
|
14953
14987
|
status = statusCode;
|
|
14954
|
-
return new
|
|
14988
|
+
return new ServerError(statusCode, message);
|
|
14955
14989
|
},
|
|
14956
14990
|
redirect: (statusCode, url2) => {
|
|
14957
14991
|
check();
|
|
@@ -14969,6 +15003,14 @@ function createRequestEvent(serverRequestEv, loadedRoute, requestHandlers, manif
|
|
|
14969
15003
|
exit2();
|
|
14970
15004
|
return new RedirectMessage();
|
|
14971
15005
|
},
|
|
15006
|
+
rewrite: (pathname) => {
|
|
15007
|
+
check();
|
|
15008
|
+
if (pathname.startsWith("http")) {
|
|
15009
|
+
throw new Error("Rewrite does not support absolute urls");
|
|
15010
|
+
}
|
|
15011
|
+
sharedMap.set(RequestEvIsRewrite, true);
|
|
15012
|
+
return new RewriteMessage(pathname.replace(/\/+/g, "/"));
|
|
15013
|
+
},
|
|
14972
15014
|
defer: (returnData) => {
|
|
14973
15015
|
return typeof returnData === "function" ? returnData : () => returnData;
|
|
14974
15016
|
},
|
|
@@ -15052,7 +15094,7 @@ var parseRequest = async ({ request, method, query }, sharedMap, qwikSerializer)
|
|
|
15052
15094
|
if (data) {
|
|
15053
15095
|
try {
|
|
15054
15096
|
return qwikSerializer._deserialize(decodeURIComponent(data));
|
|
15055
|
-
} catch
|
|
15097
|
+
} catch {
|
|
15056
15098
|
}
|
|
15057
15099
|
}
|
|
15058
15100
|
}
|
|
@@ -15080,7 +15122,7 @@ var formToObj = (formData) => {
|
|
|
15080
15122
|
|
|
15081
15123
|
// packages/qwik-router/src/middleware/request-handler/response-page.ts
|
|
15082
15124
|
function getQwikRouterServerData(requestEv) {
|
|
15083
|
-
const {
|
|
15125
|
+
const { params, request, status, locale, originalUrl } = requestEv;
|
|
15084
15126
|
const requestHeaders = {};
|
|
15085
15127
|
request.headers.forEach((value2, key) => requestHeaders[key] = value2);
|
|
15086
15128
|
const action = requestEv.sharedMap.get(RequestEvSharedActionId);
|
|
@@ -15088,7 +15130,7 @@ function getQwikRouterServerData(requestEv) {
|
|
|
15088
15130
|
const routeName = requestEv.sharedMap.get(RequestRouteName);
|
|
15089
15131
|
const nonce = requestEv.sharedMap.get(RequestEvSharedNonce);
|
|
15090
15132
|
const headers = requestEv.request.headers;
|
|
15091
|
-
const reconstructedUrl = new URL(
|
|
15133
|
+
const reconstructedUrl = new URL(originalUrl.pathname + originalUrl.search, originalUrl);
|
|
15092
15134
|
const host = headers.get("X-Forwarded-Host");
|
|
15093
15135
|
const protocol = headers.get("X-Forwarded-Proto");
|
|
15094
15136
|
if (host) {
|
|
@@ -15366,13 +15408,9 @@ async function pureServerFunction(ev) {
|
|
|
15366
15408
|
}
|
|
15367
15409
|
} catch (err) {
|
|
15368
15410
|
if (err instanceof ServerError) {
|
|
15369
|
-
ev.
|
|
15370
|
-
ev.send(err.status, await qwikSerializer._serialize([err.data]));
|
|
15371
|
-
return;
|
|
15411
|
+
throw ev.error(err.status, err.data);
|
|
15372
15412
|
}
|
|
15373
|
-
ev.
|
|
15374
|
-
ev.send(500, await qwikSerializer._serialize([err]));
|
|
15375
|
-
return;
|
|
15413
|
+
throw ev.error(500, "Invalid request");
|
|
15376
15414
|
}
|
|
15377
15415
|
if (isAsyncIterator(result)) {
|
|
15378
15416
|
ev.headers.set("Content-Type", "text/qwik-json-stream");
|
|
@@ -15404,18 +15442,19 @@ async function pureServerFunction(ev) {
|
|
|
15404
15442
|
}
|
|
15405
15443
|
function fixTrailingSlash(ev) {
|
|
15406
15444
|
const trailingSlash = getRequestTrailingSlash(ev);
|
|
15407
|
-
const { basePathname,
|
|
15445
|
+
const { basePathname, originalUrl, sharedMap } = ev;
|
|
15446
|
+
const { pathname, search: search2 } = originalUrl;
|
|
15408
15447
|
const isQData = sharedMap.has(IsQData);
|
|
15409
15448
|
if (!isQData && pathname !== basePathname && !pathname.endsWith(".html")) {
|
|
15410
15449
|
if (trailingSlash) {
|
|
15411
15450
|
if (!pathname.endsWith("/")) {
|
|
15412
|
-
throw ev.redirect(301 /* MovedPermanently */, pathname + "/" +
|
|
15451
|
+
throw ev.redirect(301 /* MovedPermanently */, pathname + "/" + search2);
|
|
15413
15452
|
}
|
|
15414
15453
|
} else {
|
|
15415
15454
|
if (pathname.endsWith("/")) {
|
|
15416
15455
|
throw ev.redirect(
|
|
15417
15456
|
301 /* MovedPermanently */,
|
|
15418
|
-
pathname.slice(0, pathname.length - 1) +
|
|
15457
|
+
pathname.slice(0, pathname.length - 1) + search2
|
|
15419
15458
|
);
|
|
15420
15459
|
}
|
|
15421
15460
|
}
|
|
@@ -15492,10 +15531,10 @@ async function handleRedirect(requestEv) {
|
|
|
15492
15531
|
return;
|
|
15493
15532
|
}
|
|
15494
15533
|
const status = requestEv.status();
|
|
15495
|
-
const
|
|
15496
|
-
const isRedirect = status >= 301 && status <= 308 &&
|
|
15534
|
+
const location = requestEv.headers.get("Location");
|
|
15535
|
+
const isRedirect = status >= 301 && status <= 308 && location;
|
|
15497
15536
|
if (isRedirect) {
|
|
15498
|
-
const adaptedLocation = makeQDataPath(
|
|
15537
|
+
const adaptedLocation = makeQDataPath(location);
|
|
15499
15538
|
if (adaptedLocation) {
|
|
15500
15539
|
requestEv.headers.set("Location", adaptedLocation);
|
|
15501
15540
|
requestEv.getWritableStream().close();
|
|
@@ -15516,7 +15555,7 @@ async function renderQData(requestEv) {
|
|
|
15516
15555
|
return;
|
|
15517
15556
|
}
|
|
15518
15557
|
const status = requestEv.status();
|
|
15519
|
-
const
|
|
15558
|
+
const redirectLocation = requestEv.headers.get("Location");
|
|
15520
15559
|
const trailingSlash = getRequestTrailingSlash(requestEv);
|
|
15521
15560
|
const requestHeaders = {};
|
|
15522
15561
|
requestEv.request.headers.forEach((value2, key) => requestHeaders[key] = value2);
|
|
@@ -15526,7 +15565,8 @@ async function renderQData(requestEv) {
|
|
|
15526
15565
|
action: requestEv.sharedMap.get(RequestEvSharedActionId),
|
|
15527
15566
|
status: status !== 200 ? status : 200,
|
|
15528
15567
|
href: getPathname(requestEv.url, trailingSlash),
|
|
15529
|
-
redirect:
|
|
15568
|
+
redirect: redirectLocation ?? void 0,
|
|
15569
|
+
isRewrite: requestEv.sharedMap.get(RequestEvIsRewrite)
|
|
15530
15570
|
};
|
|
15531
15571
|
const writer = requestEv.getWritableStream().getWriter();
|
|
15532
15572
|
const qwikSerializer = requestEv[RequestEvQwikSerializer];
|
|
@@ -25964,6 +26004,9 @@ async function createMdxTransformer(ctx) {
|
|
|
25964
26004
|
const addImport = `import { jsx } from '@qwik.dev/core';
|
|
25965
26005
|
`;
|
|
25966
26006
|
const newDefault = `
|
|
26007
|
+
function _missingMdxReference(id, component, place) {
|
|
26008
|
+
throw new Error("${id}: Expected " + (component ? "component" : "object") + " \`" + id + "\` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\\nIt\u2019s referenced in your code at \`" + place + "\`" : ""));
|
|
26009
|
+
}
|
|
25967
26010
|
const WrappedMdxContent = () => {
|
|
25968
26011
|
const content = _createMdxContent({});
|
|
25969
26012
|
return typeof MDXLayout === 'function' ? jsx(MDXLayout, {children: content}) : content;
|
|
@@ -26178,130 +26221,6 @@ function generateServiceWorkerRegister(ctx, swRegister) {
|
|
|
26178
26221
|
}
|
|
26179
26222
|
return `export default ${JSON.stringify(swReg)};`;
|
|
26180
26223
|
}
|
|
26181
|
-
function prependManifestToServiceWorker(ctx, manifest, prefetch, swCode) {
|
|
26182
|
-
const key = `/* Qwik Service Worker */`;
|
|
26183
|
-
if (swCode.includes(key)) {
|
|
26184
|
-
return null;
|
|
26185
|
-
}
|
|
26186
|
-
const appBundles = [];
|
|
26187
|
-
const appBundlesCode = generateAppBundles(appBundles, manifest);
|
|
26188
|
-
const libraryBundlesCode = generateLibraryBundles(appBundles, manifest);
|
|
26189
|
-
const [linkBundlesCode] = generateLinkBundles(ctx, appBundles, manifest, prefetch);
|
|
26190
|
-
return [key, appBundlesCode, libraryBundlesCode, linkBundlesCode, swCode].join("\n");
|
|
26191
|
-
}
|
|
26192
|
-
function generateAppBundles(appBundles, manifest) {
|
|
26193
|
-
const sortedBundles = Object.keys(manifest.bundles).sort();
|
|
26194
|
-
for (const appBundleName of sortedBundles) {
|
|
26195
|
-
const appBundle = [appBundleName, []];
|
|
26196
|
-
appBundles.push(appBundle);
|
|
26197
|
-
const symbolHashesInBundle = [];
|
|
26198
|
-
const manifestBundle = manifest.bundles[appBundleName];
|
|
26199
|
-
const importedBundleNames = Array.isArray(manifestBundle.imports) ? manifestBundle.imports : [];
|
|
26200
|
-
const depsSet = new Set(importedBundleNames);
|
|
26201
|
-
for (const importedBundleName of importedBundleNames) {
|
|
26202
|
-
clearTransitiveDeps(depsSet, /* @__PURE__ */ new Set(), importedBundleName);
|
|
26203
|
-
}
|
|
26204
|
-
appBundle[1] = Array.from(depsSet).map((dep) => sortedBundles.indexOf(dep));
|
|
26205
|
-
if (manifestBundle.symbols) {
|
|
26206
|
-
for (const manifestBundleSymbolName of manifestBundle.symbols) {
|
|
26207
|
-
const symbol = manifest.symbols[manifestBundleSymbolName];
|
|
26208
|
-
if ((symbol == null ? void 0 : symbol.hash) && !symbolHashesInBundle.includes(symbol.hash)) {
|
|
26209
|
-
symbolHashesInBundle.push(symbol.hash);
|
|
26210
|
-
}
|
|
26211
|
-
}
|
|
26212
|
-
}
|
|
26213
|
-
if (symbolHashesInBundle.length > 0) {
|
|
26214
|
-
appBundle[2] = symbolHashesInBundle;
|
|
26215
|
-
}
|
|
26216
|
-
}
|
|
26217
|
-
function clearTransitiveDeps(deps, seen, depName) {
|
|
26218
|
-
const childBundle = manifest.bundles[depName];
|
|
26219
|
-
for (const childDepImport of childBundle.imports || []) {
|
|
26220
|
-
if (deps.has(childDepImport)) {
|
|
26221
|
-
deps.delete(childDepImport);
|
|
26222
|
-
}
|
|
26223
|
-
if (!seen.has(childDepImport)) {
|
|
26224
|
-
seen.add(childDepImport);
|
|
26225
|
-
clearTransitiveDeps(deps, seen, childDepImport);
|
|
26226
|
-
}
|
|
26227
|
-
}
|
|
26228
|
-
}
|
|
26229
|
-
return `const appBundles=${JSON.stringify(appBundles)};`;
|
|
26230
|
-
}
|
|
26231
|
-
function generateLibraryBundles(appBundles, manifest) {
|
|
26232
|
-
const libraryBundleIds = [];
|
|
26233
|
-
for (const [bundleName, bundle] of Object.entries(manifest.bundles)) {
|
|
26234
|
-
if (bundle.origins && bundle.origins.includes("@qwik-router-config")) {
|
|
26235
|
-
libraryBundleIds.push(getAppBundleIndex(appBundles, bundleName));
|
|
26236
|
-
break;
|
|
26237
|
-
}
|
|
26238
|
-
}
|
|
26239
|
-
return `const libraryBundleIds=${JSON.stringify(libraryBundleIds)};`;
|
|
26240
|
-
}
|
|
26241
|
-
function generateLinkBundles(ctx, appBundles, manifest, prefetch) {
|
|
26242
|
-
var _a, _b;
|
|
26243
|
-
const linkBundles = [];
|
|
26244
|
-
const symbolToBundle = /* @__PURE__ */ new Map();
|
|
26245
|
-
const routeToBundles = {};
|
|
26246
|
-
for (const bundleName in manifest.bundles || []) {
|
|
26247
|
-
(_a = manifest.bundles[bundleName].symbols) == null ? void 0 : _a.forEach((symbol) => {
|
|
26248
|
-
const idx = symbol.lastIndexOf("_");
|
|
26249
|
-
symbolToBundle.set(idx === -1 ? symbol : symbol.substring(idx + 1), bundleName);
|
|
26250
|
-
});
|
|
26251
|
-
}
|
|
26252
|
-
for (const r2 of ctx.routes) {
|
|
26253
|
-
const linkBundleNames = [];
|
|
26254
|
-
const addFileBundles = (filePath) => {
|
|
26255
|
-
for (const [bundleName, bundle] of Object.entries(manifest.bundles)) {
|
|
26256
|
-
if (bundle.origins) {
|
|
26257
|
-
for (const bundleOrigin of bundle.origins) {
|
|
26258
|
-
const srcPath = removeExtension(filePath);
|
|
26259
|
-
const bundleOriginPath = removeExtension(bundleOrigin);
|
|
26260
|
-
if (srcPath.endsWith(bundleOriginPath)) {
|
|
26261
|
-
if (!linkBundleNames.includes(bundleName)) {
|
|
26262
|
-
linkBundleNames.push(bundleName);
|
|
26263
|
-
}
|
|
26264
|
-
if (bundle.dynamicImports) {
|
|
26265
|
-
for (const dynamicImport of bundle.dynamicImports) {
|
|
26266
|
-
if (!linkBundleNames.includes(dynamicImport)) {
|
|
26267
|
-
linkBundleNames.push(dynamicImport);
|
|
26268
|
-
}
|
|
26269
|
-
}
|
|
26270
|
-
}
|
|
26271
|
-
}
|
|
26272
|
-
}
|
|
26273
|
-
}
|
|
26274
|
-
}
|
|
26275
|
-
};
|
|
26276
|
-
for (const layout of r2.layouts) {
|
|
26277
|
-
addFileBundles(layout.filePath);
|
|
26278
|
-
}
|
|
26279
|
-
addFileBundles(r2.filePath);
|
|
26280
|
-
if (prefetch) {
|
|
26281
|
-
const symbolsForRoute = prefetch.find((p) => p.route === r2.routeName);
|
|
26282
|
-
(_b = symbolsForRoute == null ? void 0 : symbolsForRoute.symbols) == null ? void 0 : _b.reverse().forEach((symbol) => {
|
|
26283
|
-
const bundle = symbolToBundle.get(symbol);
|
|
26284
|
-
if (bundle) {
|
|
26285
|
-
const idx = linkBundleNames.indexOf(bundle);
|
|
26286
|
-
if (idx !== -1) {
|
|
26287
|
-
linkBundleNames.splice(idx, 1);
|
|
26288
|
-
}
|
|
26289
|
-
linkBundleNames.unshift(bundle);
|
|
26290
|
-
}
|
|
26291
|
-
});
|
|
26292
|
-
}
|
|
26293
|
-
linkBundles.push(
|
|
26294
|
-
`[${r2.pattern.toString()},${JSON.stringify(
|
|
26295
|
-
linkBundleNames.map((bundleName) => getAppBundleIndex(appBundles, bundleName))
|
|
26296
|
-
)}]`
|
|
26297
|
-
);
|
|
26298
|
-
routeToBundles[r2.routeName] = linkBundleNames;
|
|
26299
|
-
}
|
|
26300
|
-
return [`const linkBundles=[${linkBundles.join(",")}];`, routeToBundles];
|
|
26301
|
-
}
|
|
26302
|
-
function getAppBundleIndex(appBundles, bundleName) {
|
|
26303
|
-
return appBundles.findIndex((b) => b[0] === bundleName);
|
|
26304
|
-
}
|
|
26305
26224
|
var SW_UNREGISTER = `
|
|
26306
26225
|
navigator.serviceWorker?.getRegistrations().then((regs) => {
|
|
26307
26226
|
for (const reg of regs) {
|
|
@@ -26532,6 +26451,16 @@ function generateCodeFrame(source, start = 0, end) {
|
|
|
26532
26451
|
}
|
|
26533
26452
|
return res.join("\n");
|
|
26534
26453
|
}
|
|
26454
|
+
function parseId(originalId) {
|
|
26455
|
+
const [pathId, query] = originalId.split("?");
|
|
26456
|
+
const queryStr = query || "";
|
|
26457
|
+
return {
|
|
26458
|
+
originalId,
|
|
26459
|
+
pathId,
|
|
26460
|
+
query: queryStr ? `?${query}` : "",
|
|
26461
|
+
params: new URLSearchParams(queryStr)
|
|
26462
|
+
};
|
|
26463
|
+
}
|
|
26535
26464
|
|
|
26536
26465
|
// packages/qwik-router/src/buildtime/vite/format-error.ts
|
|
26537
26466
|
import fs4 from "node:fs";
|
|
@@ -26714,21 +26643,27 @@ function ssrDevMiddleware(ctx, server) {
|
|
|
26714
26643
|
if (requestHandlers.length > 0) {
|
|
26715
26644
|
const serverRequestEv = await fromNodeHttp(url, req, res, "dev");
|
|
26716
26645
|
Object.assign(serverRequestEv.platform, ctx.opts.platform);
|
|
26717
|
-
const manifest = {
|
|
26718
|
-
manifestHash: "",
|
|
26719
|
-
symbols: {},
|
|
26720
|
-
mapping: {},
|
|
26721
|
-
bundles: {},
|
|
26722
|
-
injections: [],
|
|
26723
|
-
version: "1"
|
|
26724
|
-
};
|
|
26725
26646
|
const { _deserialize, _serialize, _verifySerializable } = await server.ssrLoadModule("@qwik-serializer");
|
|
26726
26647
|
const qwikSerializer = { _deserialize, _serialize, _verifySerializable };
|
|
26648
|
+
const rebuildRouteInfo = async (url2) => {
|
|
26649
|
+
const { serverPlugins: serverPlugins2, loadedRoute: loadedRoute2 } = await resolveRoute2(routeModulePaths, url2);
|
|
26650
|
+
const requestHandlers2 = resolveRequestHandlers(
|
|
26651
|
+
serverPlugins2,
|
|
26652
|
+
loadedRoute2,
|
|
26653
|
+
req.method ?? "GET",
|
|
26654
|
+
false,
|
|
26655
|
+
renderFn
|
|
26656
|
+
);
|
|
26657
|
+
return {
|
|
26658
|
+
loadedRoute: loadedRoute2,
|
|
26659
|
+
requestHandlers: requestHandlers2
|
|
26660
|
+
};
|
|
26661
|
+
};
|
|
26727
26662
|
const { completion, requestEv } = runQwikRouter(
|
|
26728
26663
|
serverRequestEv,
|
|
26729
26664
|
loadedRoute,
|
|
26730
26665
|
requestHandlers,
|
|
26731
|
-
|
|
26666
|
+
rebuildRouteInfo,
|
|
26732
26667
|
ctx.opts.trailingSlash,
|
|
26733
26668
|
ctx.opts.basePathname,
|
|
26734
26669
|
qwikSerializer
|
|
@@ -26891,7 +26826,7 @@ function staticDistMiddleware({ config }) {
|
|
|
26891
26826
|
fs5.createReadStream(filePath).pipe(res);
|
|
26892
26827
|
return;
|
|
26893
26828
|
}
|
|
26894
|
-
} catch
|
|
26829
|
+
} catch {
|
|
26895
26830
|
}
|
|
26896
26831
|
}
|
|
26897
26832
|
next();
|
|
@@ -26923,7 +26858,7 @@ function formatDevSerializeError(err, routeModulePaths) {
|
|
|
26923
26858
|
if (line > -1) {
|
|
26924
26859
|
err.loc.line = line + 1;
|
|
26925
26860
|
}
|
|
26926
|
-
} catch
|
|
26861
|
+
} catch {
|
|
26927
26862
|
}
|
|
26928
26863
|
}
|
|
26929
26864
|
}
|
|
@@ -26987,29 +26922,55 @@ self.addEventListener('install', () => self.skipWaiting());
|
|
|
26987
26922
|
self.addEventListener('activate', (ev) => ev.waitUntil(self.clients.claim()));
|
|
26988
26923
|
`;
|
|
26989
26924
|
|
|
26925
|
+
// packages/qwik-router/src/buildtime/vite/get-route-imports.ts
|
|
26926
|
+
function getRouteImports(routes, manifest) {
|
|
26927
|
+
var _a, _b;
|
|
26928
|
+
const result = {};
|
|
26929
|
+
routes.forEach((route) => {
|
|
26930
|
+
const routePath = removeExtension(route.filePath);
|
|
26931
|
+
const layoutPaths = route.layouts ? route.layouts.map((layout) => removeExtension(layout.filePath)) : [];
|
|
26932
|
+
const routeAndLayoutPaths = [routePath, ...layoutPaths];
|
|
26933
|
+
const bundles = [];
|
|
26934
|
+
for (const [bundleName, bundle] of Object.entries(manifest.bundles)) {
|
|
26935
|
+
if (isBundlePartOfRoute(bundle, routeAndLayoutPaths)) {
|
|
26936
|
+
bundles.push(bundleName);
|
|
26937
|
+
}
|
|
26938
|
+
}
|
|
26939
|
+
if (bundles.length > 0) {
|
|
26940
|
+
result[route.routeName] = { dynamicImports: bundles };
|
|
26941
|
+
}
|
|
26942
|
+
});
|
|
26943
|
+
for (const bundleName of Object.keys(manifest.bundles)) {
|
|
26944
|
+
const bundle = manifest.bundles[bundleName];
|
|
26945
|
+
if ((_a = bundle.origins) == null ? void 0 : _a.some((s2) => s2.endsWith(QWIK_ROUTER_CONFIG_ID))) {
|
|
26946
|
+
result[bundleName] = {
|
|
26947
|
+
...bundle,
|
|
26948
|
+
dynamicImports: (_b = bundle.dynamicImports) == null ? void 0 : _b.filter(
|
|
26949
|
+
(d) => {
|
|
26950
|
+
var _a2;
|
|
26951
|
+
return (_a2 = manifest.bundles[d].origins) == null ? void 0 : _a2.some((s2) => s2.endsWith("menu.md"));
|
|
26952
|
+
}
|
|
26953
|
+
)
|
|
26954
|
+
};
|
|
26955
|
+
break;
|
|
26956
|
+
}
|
|
26957
|
+
}
|
|
26958
|
+
return result;
|
|
26959
|
+
}
|
|
26960
|
+
function isBundlePartOfRoute(bundle, routeAndLayoutPaths) {
|
|
26961
|
+
if (!bundle.origins) {
|
|
26962
|
+
return false;
|
|
26963
|
+
}
|
|
26964
|
+
for (const bundleOrigin of bundle.origins) {
|
|
26965
|
+
const originPath = removeExtension(bundleOrigin);
|
|
26966
|
+
return routeAndLayoutPaths.some((path3) => path3.endsWith(originPath));
|
|
26967
|
+
}
|
|
26968
|
+
}
|
|
26969
|
+
|
|
26990
26970
|
// packages/qwik-router/src/buildtime/vite/image-jsx.ts
|
|
26991
26971
|
import fs6 from "node:fs";
|
|
26992
26972
|
import path2 from "node:path";
|
|
26993
26973
|
import { optimize } from "svgo";
|
|
26994
|
-
|
|
26995
|
-
// packages/qwik/src/optimizer/src/versions.ts
|
|
26996
|
-
var versions = {
|
|
26997
|
-
qwik: globalThis.QWIK_VERSION
|
|
26998
|
-
};
|
|
26999
|
-
|
|
27000
|
-
// packages/qwik/src/optimizer/src/plugins/plugin.ts
|
|
27001
|
-
function parseId(originalId) {
|
|
27002
|
-
const [pathId, query] = originalId.split("?");
|
|
27003
|
-
const queryStr = query || "";
|
|
27004
|
-
return {
|
|
27005
|
-
originalId,
|
|
27006
|
-
pathId,
|
|
27007
|
-
query: queryStr ? `?${query}` : "",
|
|
27008
|
-
params: new URLSearchParams(queryStr)
|
|
27009
|
-
};
|
|
27010
|
-
}
|
|
27011
|
-
|
|
27012
|
-
// packages/qwik-router/src/buildtime/vite/image-jsx.ts
|
|
27013
26974
|
function imagePlugin(userOpts) {
|
|
27014
26975
|
const supportedExtensions = [".jpg", ".jpeg", ".png", ".webp", ".gif", ".avif", ".tiff"];
|
|
27015
26976
|
return [
|
|
@@ -27042,7 +27003,7 @@ function imagePlugin(userOpts) {
|
|
|
27042
27003
|
defaultDirectives: (url) => {
|
|
27043
27004
|
var _a;
|
|
27044
27005
|
if (url.searchParams.has("jsx")) {
|
|
27045
|
-
const { jsx:
|
|
27006
|
+
const { jsx: _2, ...params } = Object.fromEntries(url.searchParams.entries());
|
|
27046
27007
|
return new URLSearchParams({
|
|
27047
27008
|
format: "webp",
|
|
27048
27009
|
quality: "75",
|
|
@@ -27266,7 +27227,7 @@ function qwikRouterPlugin(userOpts) {
|
|
|
27266
27227
|
return updatedViteConfig;
|
|
27267
27228
|
},
|
|
27268
27229
|
async configResolved(config) {
|
|
27269
|
-
var _a, _b, _c;
|
|
27230
|
+
var _a, _b, _c, _d, _e;
|
|
27270
27231
|
Object.assign(process.env, loadEnv(config.mode, process.cwd(), ""));
|
|
27271
27232
|
rootDir = resolve3(config.root);
|
|
27272
27233
|
const target = ((_a = config.build) == null ? void 0 : _a.ssr) || config.mode === "ssr" ? "ssr" : "client";
|
|
@@ -27279,10 +27240,13 @@ function qwikRouterPlugin(userOpts) {
|
|
|
27279
27240
|
if (!qwikPlugin) {
|
|
27280
27241
|
throw new Error("Missing vite-plugin-qwik");
|
|
27281
27242
|
}
|
|
27282
|
-
|
|
27243
|
+
(_c = (_b = qwikPlugin.api).registerBundleGraphAdder) == null ? void 0 : _c.call(_b, (manifest) => {
|
|
27244
|
+
return getRouteImports(ctx.routes, manifest);
|
|
27245
|
+
});
|
|
27246
|
+
if (((_d = config.ssr) == null ? void 0 : _d.format) === "cjs") {
|
|
27283
27247
|
ssrFormat = "cjs";
|
|
27284
27248
|
}
|
|
27285
|
-
outDir = (
|
|
27249
|
+
outDir = (_e = config.build) == null ? void 0 : _e.outDir;
|
|
27286
27250
|
},
|
|
27287
27251
|
configureServer(server) {
|
|
27288
27252
|
return () => {
|
|
@@ -27424,34 +27388,7 @@ function qwikRouterPlugin(userOpts) {
|
|
|
27424
27388
|
sequential: true,
|
|
27425
27389
|
async handler() {
|
|
27426
27390
|
if ((ctx == null ? void 0 : ctx.target) === "ssr" && !(ctx == null ? void 0 : ctx.isDevServer)) {
|
|
27427
|
-
const manifest = qwikPlugin.api.getManifest();
|
|
27428
27391
|
const clientOutDir = qwikPlugin.api.getClientOutDir();
|
|
27429
|
-
if (manifest && clientOutDir) {
|
|
27430
|
-
const basePathRelDir = api.getBasePathname().replace(/^\/|\/$/, "");
|
|
27431
|
-
const clientOutBaseDir = join6(clientOutDir, basePathRelDir);
|
|
27432
|
-
const insightsManifest = await qwikPlugin.api.getInsightsManifest(clientOutDir);
|
|
27433
|
-
for (const swEntry of ctx.serviceWorkers) {
|
|
27434
|
-
try {
|
|
27435
|
-
const swClientDistPath = join6(clientOutBaseDir, swEntry.chunkFileName);
|
|
27436
|
-
const swCode = await fs8.promises.readFile(swClientDistPath, "utf-8");
|
|
27437
|
-
try {
|
|
27438
|
-
const swCodeUpdate = prependManifestToServiceWorker(
|
|
27439
|
-
ctx,
|
|
27440
|
-
manifest,
|
|
27441
|
-
(insightsManifest == null ? void 0 : insightsManifest.prefetch) || null,
|
|
27442
|
-
swCode
|
|
27443
|
-
);
|
|
27444
|
-
if (swCodeUpdate) {
|
|
27445
|
-
await fs8.promises.mkdir(clientOutDir, { recursive: true });
|
|
27446
|
-
await fs8.promises.writeFile(swClientDistPath, swCodeUpdate);
|
|
27447
|
-
}
|
|
27448
|
-
} catch (e2) {
|
|
27449
|
-
console.error(e2);
|
|
27450
|
-
}
|
|
27451
|
-
} catch (e) {
|
|
27452
|
-
}
|
|
27453
|
-
}
|
|
27454
|
-
}
|
|
27455
27392
|
if (outDir && clientOutDir) {
|
|
27456
27393
|
const assetsDir = qwikPlugin.api.getAssetsDir();
|
|
27457
27394
|
const { staticPathsCode, notFoundPathsCode } = await postBuild(
|