vike 0.4.238 → 0.4.239
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/cjs/node/prerender/resolvePrerenderConfig.js +3 -2
- package/dist/cjs/node/runtime/index.js +3 -3
- package/dist/cjs/node/runtime/page-files/setup.js +3 -1
- package/dist/cjs/node/runtime/renderPage/createHttpResponse.js +2 -9
- package/dist/cjs/node/runtime/renderPage/createPageContextServerSide.js +2 -2
- package/dist/cjs/node/runtime/renderPage/csp.js +47 -0
- package/dist/cjs/node/runtime/renderPage/execHookOnRenderHtml.js +2 -2
- package/dist/cjs/node/runtime/renderPage/getEarlyHints.js +1 -1
- package/dist/cjs/node/runtime/renderPage/getHttpResponseBody.js +2 -2
- package/dist/cjs/node/runtime/renderPage/headersResponse.js +48 -0
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/getHtmlTags.js +16 -13
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/getViteDevScript.js +1 -1
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/inferHtmlTags.js +8 -6
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/injectAssets__public.js +1 -1
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/injectHtmlTags.js +1 -1
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/mergeScriptTags.js +5 -3
- package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets.js +2 -2
- package/dist/cjs/node/runtime/{html → renderPage/html}/propKeys.js +1 -1
- package/dist/cjs/node/runtime/{html → renderPage/html}/renderHtml.js +1 -1
- package/dist/cjs/node/runtime/{html → renderPage/html}/serializeContext.js +6 -6
- package/dist/cjs/node/runtime/{html → renderPage/html}/stream/react-streaming.js +1 -1
- package/dist/cjs/node/runtime/{html → renderPage/html}/stream.js +1 -1
- package/dist/cjs/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +17 -38
- package/dist/cjs/node/runtime/renderPage/renderPageAfterRoute.js +2 -2
- package/dist/cjs/node/runtime/renderPage.js +1 -1
- package/dist/cjs/node/vite/onLoad.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginBuild/handleAssetsManifest.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginCommon.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginNonRunnableDev.js +4 -3
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntryWithOldDesign.js +1 -1
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +3 -0
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles.js +1 -1
- package/dist/cjs/node/vite/shared/resolveVikeConfigInternal.js +20 -22
- package/dist/cjs/shared/createGlobalContextShared.js +4 -22
- package/dist/cjs/shared/createPageContextShared.js +2 -2
- package/dist/cjs/shared/page-configs/resolveVikeConfigPublic.js +62 -43
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assert.js +16 -1
- package/dist/cjs/utils/assertNodeVersion.js +3 -1
- package/dist/cjs/utils/assertVersion.js +26 -5
- package/dist/cjs/utils/joinEnglish.js +2 -1
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.d.ts +39 -16
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.js +1 -1
- package/dist/esm/client/runtime-client-routing/getPageContextCurrent.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.d.ts +97 -83
- package/dist/esm/client/runtime-client-routing/globalContext.d.ts +38 -10
- package/dist/esm/client/runtime-client-routing/prefetch/getPrefetchSettings.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/prefetch.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/prefetch.js +2 -2
- package/dist/esm/client/runtime-client-routing/preparePageContextForPublicUsageClient.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.d.ts +43 -28
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.d.ts +39 -16
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.js +1 -1
- package/dist/esm/client/runtime-server-routing/globalContext.d.ts +38 -10
- package/dist/esm/client/runtime-server-routing/preparePageContextForPublicUsageClient.d.ts +2 -2
- package/dist/esm/client/shared/createGetGlobalContextClient.d.ts +38 -10
- package/dist/esm/client/shared/execHookOnRenderClient.d.ts +2 -2
- package/dist/esm/client/shared/loadPageConfigsLazyClientSide.d.ts +1 -1
- package/dist/esm/client/shared/loadPageConfigsLazyClientSide.js +2 -3
- package/dist/esm/client/shared/preparePageContextForPublicUsageClientShared.d.ts +2 -2
- package/dist/esm/node/prerender/resolvePrerenderConfig.js +4 -3
- package/dist/esm/node/prerender/runPrerender.d.ts +57 -14
- package/dist/esm/node/runtime/globalContext.d.ts +152 -40
- package/dist/esm/node/runtime/index.d.ts +3 -3
- package/dist/esm/node/runtime/index.js +3 -3
- package/dist/esm/node/runtime/page-files/setup.js +3 -1
- package/dist/esm/node/runtime/renderPage/createHttpResponse.d.ts +1 -1
- package/dist/esm/node/runtime/renderPage/createHttpResponse.js +2 -9
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.d.ts +52 -10
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.js +2 -2
- package/dist/esm/node/runtime/renderPage/csp.d.ts +12 -0
- package/dist/esm/node/runtime/renderPage/csp.js +45 -0
- package/dist/esm/node/runtime/renderPage/execHookOnRenderHtml.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/execHookOnRenderHtml.js +2 -2
- package/dist/esm/node/runtime/renderPage/execHookServer.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/getEarlyHints.js +1 -1
- package/dist/esm/node/runtime/renderPage/getHttpResponseBody.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/getHttpResponseBody.js +2 -2
- package/dist/esm/node/runtime/renderPage/headersResponse.d.ts +10 -0
- package/dist/esm/node/runtime/renderPage/headersResponse.js +46 -0
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/getHtmlTags.d.ts +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/getHtmlTags.js +16 -13
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/getViteDevScript.d.ts +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/getViteDevScript.js +1 -1
- package/dist/esm/node/runtime/renderPage/html/injectAssets/inferHtmlTags.d.ts +10 -0
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/inferHtmlTags.js +7 -5
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/injectAssets__public.js +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/injectHtmlTags.js +1 -1
- package/dist/esm/node/runtime/renderPage/html/injectAssets/mergeScriptTags.d.ts +3 -0
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/mergeScriptTags.js +6 -4
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets.d.ts +2 -2
- package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets.js +2 -2
- package/dist/esm/node/runtime/{html → renderPage/html}/propKeys.js +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/renderHtml.d.ts +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/renderHtml.js +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/serializeContext.d.ts +6 -5
- package/dist/esm/node/runtime/{html → renderPage/html}/serializeContext.js +6 -6
- package/dist/esm/node/runtime/{html → renderPage/html}/stream/react-streaming.js +1 -1
- package/dist/esm/node/runtime/{html → renderPage/html}/stream.js +1 -1
- package/dist/esm/node/runtime/renderPage/loadPageConfigsLazyServerSide.d.ts +62 -15
- package/dist/esm/node/runtime/renderPage/loadPageConfigsLazyServerSide.js +18 -39
- package/dist/esm/node/runtime/renderPage/preparePageContextForPublicUsageServer.d.ts +2 -2
- package/dist/esm/node/runtime/renderPage/renderPageAfterRoute.d.ts +114 -28
- package/dist/esm/node/runtime/renderPage/renderPageAfterRoute.js +2 -2
- package/dist/esm/node/runtime/renderPage.d.ts +52 -10
- package/dist/esm/node/runtime/renderPage.js +1 -1
- package/dist/esm/node/vite/onLoad.js +1 -1
- package/dist/esm/node/vite/plugins/pluginBuild/handleAssetsManifest.js +1 -1
- package/dist/esm/node/vite/plugins/pluginCommon.js +1 -1
- package/dist/esm/node/vite/plugins/pluginNonRunnableDev.js +4 -3
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntryWithOldDesign.js +2 -2
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/configDefinitionsBuiltIn.js +3 -0
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal/crawlPlusFiles.js +2 -2
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal.d.ts +4 -8
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal.js +22 -24
- package/dist/esm/shared/createGlobalContextShared.d.ts +73 -17
- package/dist/esm/shared/createGlobalContextShared.js +5 -23
- package/dist/esm/shared/createPageContextShared.d.ts +2 -7
- package/dist/esm/shared/createPageContextShared.js +2 -2
- package/dist/esm/shared/getPageFiles.d.ts +1 -1
- package/dist/esm/shared/hooks/execHook.d.ts +2 -2
- package/dist/esm/shared/hooks/getHook.d.ts +3 -3
- package/dist/esm/shared/page-configs/resolveVikeConfigPublic.d.ts +91 -31
- package/dist/esm/shared/page-configs/resolveVikeConfigPublic.js +62 -43
- package/dist/esm/types/Config/ConfigResolved.d.ts +8 -0
- package/dist/esm/types/Config.d.ts +14 -6
- package/dist/esm/types/PageContext.d.ts +8 -25
- package/dist/esm/types/VikeNamespace.d.ts +0 -27
- package/dist/esm/types/index.d.ts +2 -2
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/assert.js +16 -1
- package/dist/esm/utils/assertNodeVersion.js +3 -1
- package/dist/esm/utils/assertVersion.d.ts +4 -3
- package/dist/esm/utils/assertVersion.js +23 -5
- package/dist/esm/utils/joinEnglish.js +2 -1
- package/package.json +2 -2
- package/dist/cjs/types/Config/helpers.js +0 -2
- package/dist/esm/node/runtime/html/injectAssets/inferHtmlTags.d.ts +0 -9
- package/dist/esm/node/runtime/html/injectAssets/mergeScriptTags.d.ts +0 -2
- package/dist/esm/types/Config/PageContextConfig.d.ts +0 -15
- package/dist/esm/types/Config/helpers.d.ts +0 -10
- package/dist/esm/types/Config/helpers.js +0 -1
- /package/dist/cjs/node/runtime/{html → renderPage/html}/injectAssets/sanitizeJson.js +0 -0
- /package/dist/cjs/types/Config/{PageContextConfig.js → ConfigResolved.js} +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/injectAssets__public.d.ts +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/injectHtmlTags.d.ts +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/sanitizeJson.d.ts +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/injectAssets/sanitizeJson.js +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/propKeys.d.ts +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/stream/react-streaming.d.ts +0 -0
- /package/dist/esm/node/runtime/{html → renderPage/html}/stream.d.ts +0 -0
- /package/dist/esm/types/Config/{PageContextConfig.js → ConfigResolved.js} +0 -0
|
@@ -40,23 +40,51 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
40
40
|
headers?: Record<string, string>;
|
|
41
41
|
} & {
|
|
42
42
|
_globalContext: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
_globalConfigPublic: {
|
|
44
|
+
pages: {
|
|
45
|
+
[k: string]: {
|
|
46
|
+
config: import("../../../types/index.js").ConfigResolved;
|
|
47
|
+
_source: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
48
|
+
_sources: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
49
|
+
_from: import("../../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
50
|
+
} & ({
|
|
51
|
+
route: import("../../../types/Config.js").Route;
|
|
52
|
+
isErrorPage?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
route?: undefined;
|
|
55
|
+
isErrorPage: true;
|
|
56
|
+
});
|
|
57
|
+
};
|
|
51
58
|
config: import("../../../types/index.js").ConfigResolved;
|
|
52
59
|
_source: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
53
60
|
_sources: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
54
61
|
_from: import("../../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
55
62
|
};
|
|
56
|
-
config: import("../../../types/index.js").ConfigResolved;
|
|
57
63
|
pages: {
|
|
58
|
-
[k: string]:
|
|
64
|
+
[k: string]: {
|
|
65
|
+
config: import("../../../types/index.js").ConfigResolved;
|
|
66
|
+
_source: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
67
|
+
_sources: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
68
|
+
_from: import("../../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
69
|
+
} & ({
|
|
70
|
+
route: import("../../../types/Config.js").Route;
|
|
71
|
+
isErrorPage?: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
route?: undefined;
|
|
74
|
+
isErrorPage: true;
|
|
75
|
+
});
|
|
59
76
|
};
|
|
77
|
+
config: import("../../../types/index.js").ConfigResolved;
|
|
78
|
+
_source: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
79
|
+
_sources: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
80
|
+
_from: import("../../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
81
|
+
isGlobalContext: true;
|
|
82
|
+
_isOriginalObject: true;
|
|
83
|
+
_virtualFileExportsGlobalEntry: unknown;
|
|
84
|
+
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
85
|
+
_pageConfigs: import("../../../types/PageConfig.js").PageConfigRuntime[];
|
|
86
|
+
_pageConfigGlobal: import("../../../types/PageConfig.js").PageConfigGlobalRuntime;
|
|
87
|
+
_allPageIds: string[];
|
|
60
88
|
} & (({
|
|
61
89
|
_isProduction: false;
|
|
62
90
|
_isPrerendering: false;
|
|
@@ -108,6 +136,20 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
108
136
|
_urlHandler: ((url: string) => string) | null;
|
|
109
137
|
isClientSideNavigation: boolean;
|
|
110
138
|
} & {
|
|
139
|
+
pages: {
|
|
140
|
+
[k: string]: {
|
|
141
|
+
config: import("../../../types/index.js").ConfigResolved;
|
|
142
|
+
_source: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
143
|
+
_sources: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
144
|
+
_from: import("../../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
145
|
+
} & ({
|
|
146
|
+
route: import("../../../types/Config.js").Route;
|
|
147
|
+
isErrorPage?: undefined;
|
|
148
|
+
} | {
|
|
149
|
+
route?: undefined;
|
|
150
|
+
isErrorPage: true;
|
|
151
|
+
});
|
|
152
|
+
};
|
|
111
153
|
config: import("../../../types/index.js").ConfigResolved;
|
|
112
154
|
_source: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
113
155
|
_sources: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
@@ -123,14 +165,15 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
123
165
|
pageId: string;
|
|
124
166
|
} & {
|
|
125
167
|
_pageConfig: import("../../../types/PageConfig.js").PageConfigRuntime | null;
|
|
126
|
-
} & {
|
|
127
|
-
_pageConfig: null | import("../../../types/PageConfig.js").PageConfigRuntime;
|
|
128
|
-
} & import("../../../shared/getPageFiles.js").VikeConfigPublicPageLazyLoaded & {
|
|
168
|
+
} & import("../../../shared/getPageFiles.js").PageContextConfig & {
|
|
129
169
|
_pageConfig: null | import("../../../types/PageConfig.js").PageConfigRuntime;
|
|
170
|
+
} & {
|
|
171
|
+
cspNonce: string | null;
|
|
130
172
|
} & {
|
|
131
173
|
Page: unknown;
|
|
132
174
|
_isHtmlOnly: boolean;
|
|
133
|
-
_passToClient: import("
|
|
175
|
+
_passToClient: import("./html/serializeContext.js").PassToClient;
|
|
176
|
+
} & {
|
|
134
177
|
headersResponse: Headers;
|
|
135
178
|
} & {
|
|
136
179
|
__getPageAssets: () => Promise<import("./getPageAssets.js").PageAsset[]>;
|
|
@@ -159,23 +202,51 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
159
202
|
headers?: Record<string, string>;
|
|
160
203
|
} & {
|
|
161
204
|
_globalContext: {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
205
|
+
_globalConfigPublic: {
|
|
206
|
+
pages: {
|
|
207
|
+
[k: string]: {
|
|
208
|
+
config: import("../../../types/index.js").ConfigResolved;
|
|
209
|
+
_source: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
210
|
+
_sources: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
211
|
+
_from: import("../../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
212
|
+
} & ({
|
|
213
|
+
route: import("../../../types/Config.js").Route;
|
|
214
|
+
isErrorPage?: undefined;
|
|
215
|
+
} | {
|
|
216
|
+
route?: undefined;
|
|
217
|
+
isErrorPage: true;
|
|
218
|
+
});
|
|
219
|
+
};
|
|
170
220
|
config: import("../../../types/index.js").ConfigResolved;
|
|
171
221
|
_source: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
172
222
|
_sources: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
173
223
|
_from: import("../../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
174
224
|
};
|
|
175
|
-
config: import("../../../types/index.js").ConfigResolved;
|
|
176
225
|
pages: {
|
|
177
|
-
[k: string]:
|
|
226
|
+
[k: string]: {
|
|
227
|
+
config: import("../../../types/index.js").ConfigResolved;
|
|
228
|
+
_source: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
229
|
+
_sources: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
230
|
+
_from: import("../../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
231
|
+
} & ({
|
|
232
|
+
route: import("../../../types/Config.js").Route;
|
|
233
|
+
isErrorPage?: undefined;
|
|
234
|
+
} | {
|
|
235
|
+
route?: undefined;
|
|
236
|
+
isErrorPage: true;
|
|
237
|
+
});
|
|
178
238
|
};
|
|
239
|
+
config: import("../../../types/index.js").ConfigResolved;
|
|
240
|
+
_source: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
241
|
+
_sources: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
242
|
+
_from: import("../../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
243
|
+
isGlobalContext: true;
|
|
244
|
+
_isOriginalObject: true;
|
|
245
|
+
_virtualFileExportsGlobalEntry: unknown;
|
|
246
|
+
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
247
|
+
_pageConfigs: import("../../../types/PageConfig.js").PageConfigRuntime[];
|
|
248
|
+
_pageConfigGlobal: import("../../../types/PageConfig.js").PageConfigGlobalRuntime;
|
|
249
|
+
_allPageIds: string[];
|
|
179
250
|
} & (({
|
|
180
251
|
_isProduction: false;
|
|
181
252
|
_isPrerendering: false;
|
|
@@ -227,6 +298,20 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
227
298
|
_urlHandler: ((url: string) => string) | null;
|
|
228
299
|
isClientSideNavigation: boolean;
|
|
229
300
|
} & {
|
|
301
|
+
pages: {
|
|
302
|
+
[k: string]: {
|
|
303
|
+
config: import("../../../types/index.js").ConfigResolved;
|
|
304
|
+
_source: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
305
|
+
_sources: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
306
|
+
_from: import("../../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
307
|
+
} & ({
|
|
308
|
+
route: import("../../../types/Config.js").Route;
|
|
309
|
+
isErrorPage?: undefined;
|
|
310
|
+
} | {
|
|
311
|
+
route?: undefined;
|
|
312
|
+
isErrorPage: true;
|
|
313
|
+
});
|
|
314
|
+
};
|
|
230
315
|
config: import("../../../types/index.js").ConfigResolved;
|
|
231
316
|
_source: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
232
317
|
_sources: import("../../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
@@ -242,14 +327,15 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
242
327
|
pageId: string;
|
|
243
328
|
} & {
|
|
244
329
|
_pageConfig: import("../../../types/PageConfig.js").PageConfigRuntime | null;
|
|
245
|
-
} & {
|
|
246
|
-
_pageConfig: null | import("../../../types/PageConfig.js").PageConfigRuntime;
|
|
247
|
-
} & import("../../../shared/getPageFiles.js").VikeConfigPublicPageLazyLoaded & {
|
|
330
|
+
} & import("../../../shared/getPageFiles.js").PageContextConfig & {
|
|
248
331
|
_pageConfig: null | import("../../../types/PageConfig.js").PageConfigRuntime;
|
|
332
|
+
} & {
|
|
333
|
+
cspNonce: string | null;
|
|
249
334
|
} & {
|
|
250
335
|
Page: unknown;
|
|
251
336
|
_isHtmlOnly: boolean;
|
|
252
|
-
_passToClient: import("
|
|
337
|
+
_passToClient: import("./html/serializeContext.js").PassToClient;
|
|
338
|
+
} & {
|
|
253
339
|
headersResponse: Headers;
|
|
254
340
|
} & {
|
|
255
341
|
__getPageAssets: () => Promise<import("./getPageAssets.js").PageAsset[]>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { renderPageAfterRoute };
|
|
2
2
|
export { prerenderPage };
|
|
3
3
|
import { getErrorPageId } from '../../../shared/error-page.js';
|
|
4
|
-
import { getHtmlString } from '
|
|
4
|
+
import { getHtmlString } from './html/renderHtml.js';
|
|
5
5
|
import { assert, assertUsage, updateType, hasProp, objectAssign } from '../utils.js';
|
|
6
|
-
import { getPageContextClientSerialized } from '
|
|
6
|
+
import { getPageContextClientSerialized } from './html/serializeContext.js';
|
|
7
7
|
import { createHttpResponsePage, createHttpResponsePageContextJson } from './createHttpResponse.js';
|
|
8
8
|
import { loadPageConfigsLazyServerSide, } from './loadPageConfigsLazyServerSide.js';
|
|
9
9
|
import { execHookOnRenderHtml } from './execHookOnRenderHtml.js';
|
|
@@ -32,23 +32,51 @@ declare function getPageContextBegin(pageContextInit: PageContextInit, globalCon
|
|
|
32
32
|
/** @deprecated Set pageContextInit.headersOriginal instead */ headers?: Record<string, string>;
|
|
33
33
|
} & {
|
|
34
34
|
_globalContext: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
_globalConfigPublic: {
|
|
36
|
+
pages: {
|
|
37
|
+
[k: string]: {
|
|
38
|
+
config: import("../../types/index.js").ConfigResolved;
|
|
39
|
+
_source: import("../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
40
|
+
_sources: import("../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
41
|
+
_from: import("../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
42
|
+
} & ({
|
|
43
|
+
route: import("../../types/Config.js").Route;
|
|
44
|
+
isErrorPage?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
route?: undefined;
|
|
47
|
+
isErrorPage: true;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
43
50
|
config: import("../../types/index.js").ConfigResolved;
|
|
44
51
|
_source: import("../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
45
52
|
_sources: import("../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
46
53
|
_from: import("../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
47
54
|
};
|
|
48
|
-
config: import("../../types/index.js").ConfigResolved;
|
|
49
55
|
pages: {
|
|
50
|
-
[k: string]:
|
|
56
|
+
[k: string]: {
|
|
57
|
+
config: import("../../types/index.js").ConfigResolved;
|
|
58
|
+
_source: import("../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
59
|
+
_sources: import("../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
60
|
+
_from: import("../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
61
|
+
} & ({
|
|
62
|
+
route: import("../../types/Config.js").Route;
|
|
63
|
+
isErrorPage?: undefined;
|
|
64
|
+
} | {
|
|
65
|
+
route?: undefined;
|
|
66
|
+
isErrorPage: true;
|
|
67
|
+
});
|
|
51
68
|
};
|
|
69
|
+
config: import("../../types/index.js").ConfigResolved;
|
|
70
|
+
_source: import("../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
71
|
+
_sources: import("../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
72
|
+
_from: import("../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
73
|
+
isGlobalContext: true;
|
|
74
|
+
_isOriginalObject: true;
|
|
75
|
+
_virtualFileExportsGlobalEntry: unknown;
|
|
76
|
+
_pageFilesAll: import("../../shared/getPageFiles.js").PageFile[];
|
|
77
|
+
_pageConfigs: import("../../types/PageConfig.js").PageConfigRuntime[];
|
|
78
|
+
_pageConfigGlobal: import("../../types/PageConfig.js").PageConfigGlobalRuntime;
|
|
79
|
+
_allPageIds: string[];
|
|
52
80
|
} & (({
|
|
53
81
|
_isProduction: false;
|
|
54
82
|
_isPrerendering: false;
|
|
@@ -100,6 +128,20 @@ declare function getPageContextBegin(pageContextInit: PageContextInit, globalCon
|
|
|
100
128
|
_urlHandler: ((url: string) => string) | null;
|
|
101
129
|
isClientSideNavigation: boolean;
|
|
102
130
|
} & {
|
|
131
|
+
pages: {
|
|
132
|
+
[k: string]: {
|
|
133
|
+
config: import("../../types/index.js").ConfigResolved;
|
|
134
|
+
_source: import("../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
135
|
+
_sources: import("../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
136
|
+
_from: import("../../shared/page-configs/resolveVikeConfigPublic.js").From;
|
|
137
|
+
} & ({
|
|
138
|
+
route: import("../../types/Config.js").Route;
|
|
139
|
+
isErrorPage?: undefined;
|
|
140
|
+
} | {
|
|
141
|
+
route?: undefined;
|
|
142
|
+
isErrorPage: true;
|
|
143
|
+
});
|
|
144
|
+
};
|
|
103
145
|
config: import("../../types/index.js").ConfigResolved;
|
|
104
146
|
_source: import("../../shared/page-configs/resolveVikeConfigPublic.js").Source;
|
|
105
147
|
_sources: import("../../shared/page-configs/resolveVikeConfigPublic.js").Sources;
|
|
@@ -13,7 +13,7 @@ import { isNewError } from './renderPage/isNewError.js';
|
|
|
13
13
|
import { assertArguments } from './renderPage/assertArguments.js';
|
|
14
14
|
import { log404 } from './renderPage/log404/index.js';
|
|
15
15
|
import pc from '@brillout/picocolors';
|
|
16
|
-
import { getPageContextClientSerializedAbort, getPageContextClientSerialized } from './html/serializeContext.js';
|
|
16
|
+
import { getPageContextClientSerializedAbort, getPageContextClientSerialized, } from './renderPage/html/serializeContext.js';
|
|
17
17
|
import { getErrorPageId } from '../../shared/error-page.js';
|
|
18
18
|
import { handleErrorWithoutErrorPage } from './renderPage/handleErrorWithoutErrorPage.js';
|
|
19
19
|
import { loadPageConfigsLazyServerSide } from './renderPage/loadPageConfigsLazyServerSide.js';
|
|
@@ -13,7 +13,7 @@ function onLoad() {
|
|
|
13
13
|
// TO-DO/eventually: let's also use this.meta.viteVersion
|
|
14
14
|
// - https://github.com/vitejs/vite/pull/20088
|
|
15
15
|
// - https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md#700-2025-06-24
|
|
16
|
-
assertVersion('Vite', version, '6.0.0');
|
|
16
|
+
assertVersion('Vite', version, ['6.0.0']);
|
|
17
17
|
// Ensure we don't bloat the server runtime with heavy dependencies such Vite and esbuild
|
|
18
18
|
assertIsNotProductionRuntime();
|
|
19
19
|
}
|
|
@@ -19,7 +19,7 @@ import { getManifestFilePathRelative } from '../../shared/getManifestFilePathRel
|
|
|
19
19
|
const globalObject = getGlobalObject('build/handleAssetsManifest.ts', {
|
|
20
20
|
assetsJsonFilePath: undefined,
|
|
21
21
|
});
|
|
22
|
-
//
|
|
22
|
+
// yes => use workaround config.build.ssrEmitAssets
|
|
23
23
|
// false => use workaround extractAssets plugin
|
|
24
24
|
function handleAssetsManifest_isFixEnabled() {
|
|
25
25
|
// Allow user to toggle between the two workarounds? E.g. based on https://vike.dev/includeAssetsImportedByServer.
|
|
@@ -107,7 +107,7 @@ function setDefault(setting, value, configFromUser, configFromVike) {
|
|
|
107
107
|
/*
|
|
108
108
|
import { version } from 'vite'
|
|
109
109
|
function overrideViteDefaultSsrExternal(config: ResolvedConfig) {
|
|
110
|
-
if (!
|
|
110
|
+
if (!isVersionMatch(version, ['5.0.12'])) return
|
|
111
111
|
// @ts-ignore Not released yet: https://github.com/vitejs/vite/pull/10939/files#diff-5a3d42620df2c6b17e25f440ffdb67683dee7ef57317674d19f41d5f30502310L5
|
|
112
112
|
config.ssr.external ??= true
|
|
113
113
|
}
|
|
@@ -32,15 +32,16 @@ function pluginNonRunnableDev() {
|
|
|
32
32
|
transform(code, id) {
|
|
33
33
|
if (!config._isDev)
|
|
34
34
|
return;
|
|
35
|
-
|
|
35
|
+
const idWithoutQuery = id.split('?')[0];
|
|
36
|
+
if (idWithoutQuery !== distFileIsNonRunnableDev && idWithoutQuery !== distFileGlobalContext)
|
|
36
37
|
return;
|
|
37
38
|
if (isRunnableDevEnvironment(this.environment))
|
|
38
39
|
return;
|
|
39
40
|
const { magicString, getMagicStringResult } = getMagicString(code, id);
|
|
40
|
-
if (
|
|
41
|
+
if (idWithoutQuery === distFileIsNonRunnableDev) {
|
|
41
42
|
magicString.replaceAll('__VIKE__IS_NON_RUNNABLE_DEV', JSON.stringify(true));
|
|
42
43
|
}
|
|
43
|
-
if (
|
|
44
|
+
if (idWithoutQuery === distFileGlobalContext) {
|
|
44
45
|
magicString.replaceAll('__VIKE__DYNAMIC_IMPORT', 'import');
|
|
45
46
|
}
|
|
46
47
|
return getMagicStringResult();
|
package/dist/esm/node/vite/plugins/pluginVirtualFiles/generateVirtualFileGlobalEntryWithOldDesign.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { generateVirtualFileGlobalEntryWithOldDesign };
|
|
2
|
-
import { assert, assertPosixPath, scriptFileExtensionPattern, debugGlob,
|
|
2
|
+
import { assert, assertPosixPath, scriptFileExtensionPattern, debugGlob, isVersionMatch, assertWarning, } from '../../utils.js';
|
|
3
3
|
import { parseVirtualFileId } from '../../../shared/virtualFileId.js';
|
|
4
4
|
import { version as viteVersion } from 'vite';
|
|
5
5
|
import { fileTypes } from '../../../../shared/getPageFiles/fileTypes.js';
|
|
@@ -139,7 +139,7 @@ function getGlobs(globRoots, isBuild, fileType, query, isV1Design) {
|
|
|
139
139
|
const globExcludePath = globRoot.excludeDir ? `'!${getGlobPath(globRoot.excludeDir, fileType)}'` : null;
|
|
140
140
|
const globOptions = { eager: isEager };
|
|
141
141
|
if (query) {
|
|
142
|
-
const isNewViteInterface =
|
|
142
|
+
const isNewViteInterface = isVersionMatch(viteVersion, ['5.1.0']);
|
|
143
143
|
if (isNewViteInterface &&
|
|
144
144
|
// When used for the old design, the new syntax breaks Vike's CI (surprinsigly so). I couldn't reproduce locally (I didn't dig much).
|
|
145
145
|
isV1Design) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { crawlPlusFiles };
|
|
2
2
|
export { isPlusFile };
|
|
3
3
|
export { getPlusFileValueConfigName };
|
|
4
|
-
import { assertPosixPath, assert, scriptFileExtensionPattern, assertIsNotProductionRuntime,
|
|
4
|
+
import { assertPosixPath, assert, scriptFileExtensionPattern, assertIsNotProductionRuntime, isVersionMatch, isScriptFile, scriptFileExtensionList, createDebugger, deepEqual, assertUsage, assertFilePathAbsoluteFilesystem, assertWarning, hasProp, isNotNullish, getGlobalObject, } from '../../utils.js';
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { glob } from 'tinyglobby';
|
|
7
7
|
import { exec } from 'node:child_process';
|
|
@@ -147,7 +147,7 @@ async function isGitNotUsable(userRootDir) {
|
|
|
147
147
|
// - We didn't bother test which is the earliest version that works.
|
|
148
148
|
// - Git 2.32.0 doesn't seem to work: https://github.com/vikejs/vike/discussions/1549
|
|
149
149
|
// - Maybe it's because of StackBlitz: looking at the release notes, Git 2.32.0 should be working.
|
|
150
|
-
if (!
|
|
150
|
+
if (!isVersionMatch(gitVersion, ['2.43.1']))
|
|
151
151
|
return true;
|
|
152
152
|
}
|
|
153
153
|
// Is userRootDir inside a Git repository?
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { getVikeConfig };
|
|
2
|
+
export type { VikeConfig };
|
|
1
3
|
export { getVikeConfigInternal };
|
|
2
4
|
export { getVikeConfigInternalOptional };
|
|
3
5
|
export { getVikeConfigInternalSync };
|
|
@@ -9,11 +11,9 @@ export { getConfigDefinitionOptional };
|
|
|
9
11
|
export { getVikeConfigFromCliOrEnv };
|
|
10
12
|
export type { VikeConfigInternal };
|
|
11
13
|
export type { PageConfigBuildTimeBeforeComputed };
|
|
12
|
-
export { getVikeConfig };
|
|
13
|
-
export type { VikeConfig };
|
|
14
14
|
import type { PageConfigGlobalBuildTime, PageConfigBuildTime } from '../../../types/PageConfig.js';
|
|
15
15
|
import { type ConfigDefinitionsInternal, type ConfigDefinitionInternal } from './resolveVikeConfigInternal/configDefinitionsBuiltIn.js';
|
|
16
|
-
import { type
|
|
16
|
+
import { type GlobalConfigPublic } from '../../../shared/page-configs/resolveVikeConfigPublic.js';
|
|
17
17
|
import { type PlusFile } from './resolveVikeConfigInternal/getPlusFilesAll.js';
|
|
18
18
|
import type { PrerenderContextPublic } from '../../prerender/runPrerender.js';
|
|
19
19
|
import type { ResolvedConfig, UserConfig } from 'vite';
|
|
@@ -28,13 +28,9 @@ type PrerenderContext = {
|
|
|
28
28
|
} & ({
|
|
29
29
|
[K in keyof PrerenderContextPublic]: null;
|
|
30
30
|
} | PrerenderContextPublic);
|
|
31
|
-
type VikeConfigInternal = {
|
|
31
|
+
type VikeConfigInternal = GlobalConfigPublic & {
|
|
32
32
|
_pageConfigs: PageConfigBuildTime[];
|
|
33
33
|
_pageConfigGlobal: PageConfigGlobalBuildTime;
|
|
34
|
-
config: VikeConfigPublicGlobal['config'];
|
|
35
|
-
_from: VikeConfigPublicGlobal['_from'];
|
|
36
|
-
pages: Record<string, // pageId
|
|
37
|
-
VikeConfigPublicPageEagerLoaded>;
|
|
38
34
|
_vikeConfigDependencies: Set<string>;
|
|
39
35
|
prerenderContext: PrerenderContext;
|
|
40
36
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// Public usage
|
|
2
|
+
export { getVikeConfig };
|
|
1
3
|
// Internal usage
|
|
2
4
|
export { getVikeConfigInternal };
|
|
3
5
|
export { getVikeConfigInternalOptional };
|
|
@@ -8,8 +10,6 @@ export { isV1Design };
|
|
|
8
10
|
export { getConfVal };
|
|
9
11
|
export { getConfigDefinitionOptional };
|
|
10
12
|
export { getVikeConfigFromCliOrEnv };
|
|
11
|
-
// Public usage
|
|
12
|
-
export { getVikeConfig };
|
|
13
13
|
import { assertPosixPath, assert, isObject, assertUsage, assertWarning, objectEntries, hasProp, includes, assertIsNotProductionRuntime, getMostSimilar, joinEnglish, assertKeys, objectKeys, objectFromEntries, unique, isCallable, makeFirst, lowerFirst, makeLast, genPromise, checkType, objectAssign, getGlobalObject, } from '../utils.js';
|
|
14
14
|
import { configDefinitionsBuiltIn, } from './resolveVikeConfigInternal/configDefinitionsBuiltIn.js';
|
|
15
15
|
import { getLocationId, getFilesystemRouteString, getFilesystemRouteDefinedBy, isInherited, sortAfterInheritanceOrder, applyFilesystemRoutingRootEffect, } from './resolveVikeConfigInternal/filesystemRouting.js';
|
|
@@ -22,7 +22,7 @@ import { loadPointerImport, loadValueFile } from './resolveVikeConfigInternal/lo
|
|
|
22
22
|
import { resolvePointerImport } from './resolveVikeConfigInternal/resolvePointerImport.js';
|
|
23
23
|
import { getFilePathResolved } from './getFilePath.js';
|
|
24
24
|
import { getConfigValueBuildTime } from '../../../shared/page-configs/getConfigValueBuildTime.js';
|
|
25
|
-
import {
|
|
25
|
+
import { resolveGlobalConfigPublic, } from '../../../shared/page-configs/resolveVikeConfigPublic.js';
|
|
26
26
|
import { getConfigValuesBase, isJsonValue } from '../../../shared/page-configs/serialize/serializeConfigValues.js';
|
|
27
27
|
import { getPlusFilesAll, } from './resolveVikeConfigInternal/getPlusFilesAll.js';
|
|
28
28
|
import { getEnvVarObject } from './getEnvVarObject.js';
|
|
@@ -170,31 +170,26 @@ async function resolveVikeConfigInternal(userRootDir, vikeVitePluginOptions, esb
|
|
|
170
170
|
// Backwards compatibility for vike(options) in vite.config.js
|
|
171
171
|
temp_interopVikeVitePlugin(pageConfigGlobal, vikeVitePluginOptions, userRootDir);
|
|
172
172
|
setCliAndApiOptions(pageConfigGlobal, configDefinitionsResolved);
|
|
173
|
-
|
|
174
|
-
const pageConfigGlobalValues = getConfigValues(pageConfigGlobal);
|
|
175
|
-
const vikeConfigPublicGlobal = resolveVikeConfigPublicGlobal({ pageConfigGlobalValues });
|
|
176
|
-
// pages
|
|
177
|
-
const vikeConfigPublicPagesEager = objectFromEntries(pageConfigs.map((pageConfig) => {
|
|
178
|
-
const pageConfigValues = getConfigValues(pageConfig, true);
|
|
179
|
-
return resolveVikeConfigPublicPageEagerLoaded(pageConfigGlobalValues, pageConfig, pageConfigValues);
|
|
180
|
-
}));
|
|
173
|
+
const globalConfigPublic = resolveGlobalConfig(pageConfigGlobal, pageConfigs);
|
|
181
174
|
const prerenderContext = resolvePrerenderContext({
|
|
182
|
-
config:
|
|
183
|
-
_from:
|
|
175
|
+
config: globalConfigPublic.config,
|
|
176
|
+
_from: globalConfigPublic._from,
|
|
184
177
|
_pageConfigs: pageConfigs,
|
|
185
178
|
});
|
|
186
179
|
const vikeConfig = {
|
|
180
|
+
...globalConfigPublic,
|
|
181
|
+
prerenderContext,
|
|
187
182
|
_pageConfigs: pageConfigs,
|
|
188
183
|
_pageConfigGlobal: pageConfigGlobal,
|
|
189
|
-
config: vikeConfigPublicGlobal.config,
|
|
190
|
-
_from: vikeConfigPublicGlobal._from,
|
|
191
|
-
pages: vikeConfigPublicPagesEager,
|
|
192
|
-
prerenderContext,
|
|
193
184
|
_vikeConfigDependencies: esbuildCache.vikeConfigDependencies,
|
|
194
185
|
};
|
|
195
186
|
globalObject.vikeConfigSync = vikeConfig;
|
|
196
187
|
return vikeConfig;
|
|
197
188
|
}
|
|
189
|
+
function resolveGlobalConfig(pageConfigGlobal, pageConfigs) {
|
|
190
|
+
const globalConfigPublic = resolveGlobalConfigPublic(pageConfigs, pageConfigGlobal, getConfigValues);
|
|
191
|
+
return globalConfigPublic;
|
|
192
|
+
}
|
|
198
193
|
async function resolveConfigDefinitions(plusFilesAll, userRootDir, esbuildCache) {
|
|
199
194
|
const plusFilesAllOrdered = Object.values(plusFilesAll)
|
|
200
195
|
.flat()
|
|
@@ -358,7 +353,8 @@ function assertOnBeforeRenderEnv(pageConfig) {
|
|
|
358
353
|
// When using Server Routing, loading a onBeforeRender() hook on the client-side hasn't any effect (the Server Routing's client runtime never calls it); it unnecessarily bloats client bundle sizes
|
|
359
354
|
assertUsage(!(onBeforeRenderEnv.client && !isClientRouting), `Page ${pageConfig.pageId} has an onBeforeRender() hook with env ${pc.cyan(JSON.stringify(onBeforeRenderEnv))} which doesn't make sense because the page is using Server Routing: onBeforeRender() can be run in the client only when using Client Routing.`);
|
|
360
355
|
}
|
|
361
|
-
function getConfigValues(pageConfig,
|
|
356
|
+
function getConfigValues(pageConfig, isGlobalConfig) {
|
|
357
|
+
const tolerateMissingValue = !isGlobalConfig;
|
|
362
358
|
const configValues = {};
|
|
363
359
|
getConfigValuesBase(pageConfig, { isForConfig: true }, null).forEach((entry) => {
|
|
364
360
|
if (entry.configValueBase.type === 'computed') {
|
|
@@ -1125,11 +1121,15 @@ function restartViteDevServer() {
|
|
|
1125
1121
|
removeSuperfluousViteLog_disable();
|
|
1126
1122
|
}
|
|
1127
1123
|
function getVikeConfigDummy(esbuildCache) {
|
|
1128
|
-
const globalDummy = resolveVikeConfigPublicGlobal({ pageConfigGlobalValues: {} });
|
|
1129
1124
|
const pageConfigsDummy = [];
|
|
1125
|
+
const pageConfigGlobalDummy = {
|
|
1126
|
+
configValueSources: {},
|
|
1127
|
+
configDefinitions: {},
|
|
1128
|
+
};
|
|
1129
|
+
const globalConfigPublicDummy = resolveGlobalConfig(pageConfigGlobalDummy, pageConfigsDummy);
|
|
1130
1130
|
const prerenderContextDummy = resolvePrerenderContext({
|
|
1131
|
-
config:
|
|
1132
|
-
_from:
|
|
1131
|
+
config: globalConfigPublicDummy.config,
|
|
1132
|
+
_from: globalConfigPublicDummy._from,
|
|
1133
1133
|
_pageConfigs: pageConfigsDummy,
|
|
1134
1134
|
});
|
|
1135
1135
|
const vikeConfigDummy = {
|
|
@@ -1138,9 +1138,7 @@ function getVikeConfigDummy(esbuildCache) {
|
|
|
1138
1138
|
configDefinitions: {},
|
|
1139
1139
|
configValueSources: {},
|
|
1140
1140
|
},
|
|
1141
|
-
|
|
1142
|
-
_from: globalDummy._from,
|
|
1143
|
-
pages: {},
|
|
1141
|
+
...globalConfigPublicDummy,
|
|
1144
1142
|
prerenderContext: prerenderContextDummy,
|
|
1145
1143
|
_vikeConfigDependencies: esbuildCache.vikeConfigDependencies,
|
|
1146
1144
|
};
|