vike 0.4.220-commit-a9f46b8 → 0.4.220-commit-9a798ce
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/api/utils.js +1 -1
- package/dist/cjs/{utils → node/plugin}/getOutDirs.js +11 -11
- package/dist/cjs/node/plugin/index.js +1 -7
- package/dist/cjs/node/plugin/onLoad.js +6 -1
- package/dist/cjs/node/plugin/plugins/autoFullBuild.js +12 -13
- package/dist/cjs/node/plugin/plugins/baseUrls.js +2 -2
- package/dist/cjs/node/plugin/plugins/buildConfig.js +6 -3
- package/dist/cjs/node/plugin/plugins/buildEntry/index.js +24 -21
- package/dist/cjs/node/plugin/plugins/commonConfig.js +4 -3
- package/dist/cjs/node/plugin/plugins/extractAssetsPlugin.js +4 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +10 -7
- package/dist/cjs/node/plugin/plugins/importUserCode/index.js +3 -4
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/assertExtensions.js +10 -9
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +8 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +158 -176
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +3 -1
- package/dist/cjs/node/plugin/plugins/previewConfig.js +3 -4
- package/dist/cjs/node/plugin/utils.js +1 -1
- package/dist/cjs/node/prerender/context.js +6 -4
- package/dist/cjs/node/prerender/resolvePrerenderConfig.js +25 -0
- package/dist/cjs/node/prerender/runPrerender.js +9 -4
- package/dist/cjs/node/prerender/utils.js +2 -2
- package/dist/cjs/node/runtime/globalContext.js +42 -36
- package/dist/cjs/node/runtime/renderPage/renderPageAlreadyRouted.js +6 -3
- package/dist/cjs/node/runtime/renderPage/resolveRedirects.js +6 -5
- package/dist/cjs/node/runtime/renderPage.js +10 -5
- package/dist/cjs/node/runtime/utils.js +2 -2
- package/dist/cjs/node/shared/resolveBase.js +9 -0
- package/dist/cjs/shared/page-configs/getPageConfigUserFriendly.js +2 -2
- package/dist/cjs/shared/utils.js +1 -1
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/findFile.js +3 -3
- package/dist/cjs/utils/isDev.js +2 -1
- package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +2 -2
- package/dist/cjs/utils/requireResolve.js +3 -3
- package/dist/esm/node/api/utils.d.ts +1 -1
- package/dist/esm/node/api/utils.js +1 -1
- package/dist/esm/{utils → node/plugin}/getOutDirs.js +5 -5
- package/dist/esm/node/plugin/index.d.ts +29 -1
- package/dist/esm/node/plugin/index.js +2 -8
- package/dist/esm/node/plugin/onLoad.js +7 -2
- package/dist/esm/node/plugin/plugins/autoFullBuild.js +12 -13
- package/dist/esm/node/plugin/plugins/baseUrls.js +2 -2
- package/dist/esm/node/plugin/plugins/buildConfig.js +7 -4
- package/dist/esm/node/plugin/plugins/buildEntry/index.d.ts +3 -3
- package/dist/esm/node/plugin/plugins/buildEntry/index.js +25 -22
- package/dist/esm/node/plugin/plugins/commonConfig.d.ts +1 -1
- package/dist/esm/node/plugin/plugins/commonConfig.js +4 -3
- package/dist/esm/node/plugin/plugins/extractAssetsPlugin.js +4 -2
- package/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.d.ts +2 -2
- package/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +10 -7
- package/dist/esm/node/plugin/plugins/importUserCode/index.js +3 -4
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/assertExtensions.d.ts +3 -2
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/assertExtensions.js +10 -9
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js +8 -3
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.d.ts +2 -95
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +159 -177
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVirtualFilePageConfigValuesAll.js +3 -1
- package/dist/esm/node/plugin/plugins/previewConfig.js +3 -4
- package/dist/esm/node/plugin/utils.js +1 -1
- package/dist/esm/node/prerender/context.d.ts +2 -2
- package/dist/esm/node/prerender/context.js +6 -4
- package/dist/esm/node/prerender/resolvePrerenderConfig.d.ts +5 -0
- package/dist/esm/node/prerender/resolvePrerenderConfig.js +23 -0
- package/dist/esm/node/prerender/runPrerender.js +9 -4
- package/dist/esm/node/prerender/utils.d.ts +2 -2
- package/dist/esm/node/prerender/utils.js +2 -2
- package/dist/esm/node/runtime/globalContext.d.ts +15 -9
- package/dist/esm/node/runtime/globalContext.js +43 -37
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +5 -5
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.js +6 -3
- package/dist/esm/node/runtime/renderPage/resolveRedirects.d.ts +2 -0
- package/dist/esm/node/runtime/renderPage/resolveRedirects.js +5 -5
- package/dist/esm/node/runtime/renderPage.js +10 -5
- package/dist/esm/node/runtime/utils.d.ts +2 -2
- package/dist/esm/node/runtime/utils.js +2 -2
- package/dist/esm/node/shared/resolveBase.d.ts +4 -1
- package/dist/esm/node/shared/resolveBase.js +9 -0
- package/dist/esm/shared/page-configs/Config.d.ts +76 -3
- package/dist/esm/shared/page-configs/PageConfig.d.ts +25 -19
- package/dist/esm/shared/page-configs/getPageConfigUserFriendly.d.ts +1 -1
- package/dist/esm/shared/page-configs/getPageConfigUserFriendly.js +2 -2
- package/dist/esm/shared/utils.d.ts +1 -1
- package/dist/esm/shared/utils.js +1 -1
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/findFile.js +1 -1
- package/dist/esm/utils/isDev.js +2 -1
- package/dist/esm/utils/isFilePathAbsoluteFilesystem.js +1 -1
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/dist/esm/utils/requireResolve.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/node/plugin/plugins/buildEntry/getVikeManifest.js +0 -17
- package/dist/cjs/node/shared/assertPluginManifest.js +0 -20
- package/dist/cjs/node/shared/assertRuntimeManifest.js +0 -16
- package/dist/esm/node/plugin/plugins/buildEntry/getVikeManifest.d.ts +0 -5
- package/dist/esm/node/plugin/plugins/buildEntry/getVikeManifest.js +0 -15
- package/dist/esm/node/shared/assertPluginManifest.d.ts +0 -12
- package/dist/esm/node/shared/assertPluginManifest.js +0 -18
- package/dist/esm/node/shared/assertRuntimeManifest.d.ts +0 -10
- package/dist/esm/node/shared/assertRuntimeManifest.js +0 -14
- /package/dist/cjs/utils/{filesystemPathHandling.js → toPosixPath.js} +0 -0
- /package/dist/esm/{utils → node/plugin}/getOutDirs.d.ts +0 -0
- /package/dist/esm/utils/{filesystemPathHandling.d.ts → toPosixPath.d.ts} +0 -0
- /package/dist/esm/utils/{filesystemPathHandling.js → toPosixPath.js} +0 -0
|
@@ -28,6 +28,7 @@ import { executeHook, isUserHookError } from '../../shared/hooks/executeHook.js'
|
|
|
28
28
|
import { getConfigValueBuildTime } from '../../shared/page-configs/getConfigValueBuildTime.js';
|
|
29
29
|
import { prepareViteApiCall } from '../api/prepareViteApiCall.js';
|
|
30
30
|
import { setContextIsPrerendering } from './context.js';
|
|
31
|
+
import { resolvePrerenderConfig } from './resolvePrerenderConfig.js';
|
|
31
32
|
async function runPrerenderFromAPI(options = {}) {
|
|
32
33
|
return await runPrerender(options, 'prerender()');
|
|
33
34
|
// - We purposely propagate the error to the user land, so that the error interrupts the user land. It's also, I guess, a nice-to-have that the user has control over the error.
|
|
@@ -74,7 +75,7 @@ async function runPrerender(options = {}, standaloneTrigger) {
|
|
|
74
75
|
const vikeConfig = await getVikeConfig(viteConfig);
|
|
75
76
|
const { outDirClient } = getOutDirs(viteConfig);
|
|
76
77
|
const { root } = viteConfig;
|
|
77
|
-
const prerenderConfig = vikeConfig.
|
|
78
|
+
const prerenderConfig = resolvePrerenderConfig(vikeConfig.global.config.prerender);
|
|
78
79
|
validatePrerenderConfig(prerenderConfig);
|
|
79
80
|
if (!prerenderConfig) {
|
|
80
81
|
assert(standaloneTrigger);
|
|
@@ -122,9 +123,13 @@ async function collectDoNoPrerenderList(pageConfigs, doNotPrerenderList, concurr
|
|
|
122
123
|
// V1 design
|
|
123
124
|
pageConfigs.forEach((pageConfig) => {
|
|
124
125
|
const configName = 'prerender';
|
|
125
|
-
const configValue = getConfigValueBuildTime(pageConfig, configName
|
|
126
|
-
if (configValue
|
|
127
|
-
|
|
126
|
+
const configValue = getConfigValueBuildTime(pageConfig, configName);
|
|
127
|
+
if (!configValue)
|
|
128
|
+
return;
|
|
129
|
+
assert(hasProp(configValue, 'value', 'array'));
|
|
130
|
+
if (configValue.value[0] === false) {
|
|
131
|
+
assert(isArray(configValue.definedAtData));
|
|
132
|
+
const configValueFilePathToShowToUser = getConfigValueFilePathToShowToUser(configValue.definedAtData[0]);
|
|
128
133
|
assert(configValueFilePathToShowToUser);
|
|
129
134
|
doNotPrerenderList.push({
|
|
130
135
|
pageId: pageConfig.pageId,
|
|
@@ -4,9 +4,9 @@ export * from '../../utils/projectInfo.js';
|
|
|
4
4
|
export * from '../../utils/objectAssign.js';
|
|
5
5
|
export * from '../../utils/isObjectWithKeys.js';
|
|
6
6
|
export * from '../../utils/isCallable.js';
|
|
7
|
-
export * from '
|
|
7
|
+
export * from '../plugin/getOutDirs.js';
|
|
8
8
|
export * from '../../utils/isPropertyGetter.js';
|
|
9
|
-
export * from '../../utils/
|
|
9
|
+
export * from '../../utils/toPosixPath.js';
|
|
10
10
|
export * from '../../utils/urlToFile.js';
|
|
11
11
|
export * from '../../utils/isPlainObject.js';
|
|
12
12
|
export * from '../../utils/assertSetup.js';
|
|
@@ -6,9 +6,9 @@ export * from '../../utils/projectInfo.js';
|
|
|
6
6
|
export * from '../../utils/objectAssign.js';
|
|
7
7
|
export * from '../../utils/isObjectWithKeys.js';
|
|
8
8
|
export * from '../../utils/isCallable.js';
|
|
9
|
-
export * from '
|
|
9
|
+
export * from '../plugin/getOutDirs.js';
|
|
10
10
|
export * from '../../utils/isPropertyGetter.js';
|
|
11
|
-
export * from '../../utils/
|
|
11
|
+
export * from '../../utils/toPosixPath.js';
|
|
12
12
|
export * from '../../utils/urlToFile.js';
|
|
13
13
|
export * from '../../utils/isPlainObject.js';
|
|
14
14
|
export * from '../../utils/assertSetup.js';
|
|
@@ -3,7 +3,6 @@ export { getGlobalContextAsync };
|
|
|
3
3
|
export { getGlobalContext };
|
|
4
4
|
export { getViteDevServer };
|
|
5
5
|
export { getViteConfig };
|
|
6
|
-
export { getRuntimeManifest };
|
|
7
6
|
export { initGlobalContext_renderPage };
|
|
8
7
|
export { initGlobalContext_runPrerender };
|
|
9
8
|
export { initGlobalContext_getGlobalContextAsync };
|
|
@@ -14,10 +13,11 @@ export { setGlobalContext_isViteDev };
|
|
|
14
13
|
export { setGlobalContext_isPrerendering };
|
|
15
14
|
export { setGlobalContext_buildEntry };
|
|
16
15
|
export { clearGlobalContext };
|
|
16
|
+
export { assertBuildInfo };
|
|
17
|
+
export { getViteConfigRuntime };
|
|
18
|
+
export type { BuildInfo };
|
|
17
19
|
import type { ViteManifest } from '../shared/ViteManifest.js';
|
|
18
20
|
import type { ResolvedConfig, ViteDevServer } from 'vite';
|
|
19
|
-
import type { VikeConfigGlobal } from '../plugin/plugins/importUserCode/v1-design/getVikeConfig.js';
|
|
20
|
-
import { type RuntimeManifest } from '../shared/assertRuntimeManifest.js';
|
|
21
21
|
import type { VikeConfigObject } from '../plugin/plugins/importUserCode/v1-design/getVikeConfig.js';
|
|
22
22
|
import type { ConfigUserFriendly } from '../../shared/page-configs/getPageConfigUserFriendly.js';
|
|
23
23
|
type GlobalContextPublic = {
|
|
@@ -25,11 +25,9 @@ type GlobalContextPublic = {
|
|
|
25
25
|
};
|
|
26
26
|
type PageRuntimeInfo = Awaited<ReturnType<typeof getPageRuntimeInfo>>['userFiles'];
|
|
27
27
|
type GlobalContext = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
trailingSlash: boolean;
|
|
32
|
-
disableUrlNormalization: boolean;
|
|
28
|
+
viteConfigRuntime: {
|
|
29
|
+
_baseViteOriginal: null | string;
|
|
30
|
+
};
|
|
33
31
|
vikeConfig: {
|
|
34
32
|
global: ConfigUserFriendly;
|
|
35
33
|
};
|
|
@@ -77,6 +75,14 @@ declare function getPageRuntimeInfo(isProduction: boolean): Promise<{
|
|
|
77
75
|
};
|
|
78
76
|
globalConfig: ConfigUserFriendly;
|
|
79
77
|
}>;
|
|
80
|
-
declare function getRuntimeManifest(vikeConfigGlobal: VikeConfigGlobal, viteConfig: ResolvedConfig): RuntimeManifest;
|
|
81
78
|
declare function setGlobalContext_buildEntry(buildEntry: unknown): void;
|
|
79
|
+
type BuildInfo = {
|
|
80
|
+
versionAtBuildTime: string;
|
|
81
|
+
usesClientRouter: boolean;
|
|
82
|
+
viteConfigRuntime: {
|
|
83
|
+
_baseViteOriginal: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
declare function assertBuildInfo(buildInfo: unknown): asserts buildInfo is BuildInfo;
|
|
87
|
+
declare function getViteConfigRuntime(viteConfig: ResolvedConfig): BuildInfo['viteConfigRuntime'];
|
|
82
88
|
declare function clearGlobalContext(): void;
|
|
@@ -5,7 +5,6 @@ export { getGlobalContextAsync };
|
|
|
5
5
|
export { getGlobalContext };
|
|
6
6
|
export { getViteDevServer };
|
|
7
7
|
export { getViteConfig };
|
|
8
|
-
export { getRuntimeManifest };
|
|
9
8
|
export { initGlobalContext_renderPage };
|
|
10
9
|
export { initGlobalContext_runPrerender };
|
|
11
10
|
export { initGlobalContext_getGlobalContextAsync };
|
|
@@ -16,14 +15,13 @@ export { setGlobalContext_isViteDev };
|
|
|
16
15
|
export { setGlobalContext_isPrerendering };
|
|
17
16
|
export { setGlobalContext_buildEntry };
|
|
18
17
|
export { clearGlobalContext };
|
|
19
|
-
|
|
18
|
+
export { assertBuildInfo };
|
|
19
|
+
export { getViteConfigRuntime };
|
|
20
|
+
import { assert, onSetupRuntime, assertUsage, assertWarning, isPlainObject, objectAssign, objectReplace, isObject, hasProp, debugGlob, getGlobalObject, genPromise, createDebugger, makePublicCopy, projectInfo, checkType } from './utils.js';
|
|
20
21
|
import { importServerProductionEntry } from '@brillout/vite-plugin-server-entry/runtime';
|
|
21
22
|
import { virtualFileIdImportUserCodeServer } from '../shared/virtual-files/virtualFileImportUserCode.js';
|
|
22
23
|
import { getPageFilesAll, setPageFiles, setPageFilesAsync } from '../../shared/getPageFiles/getPageFiles.js';
|
|
23
|
-
import { assertPluginManifest } from '../shared/assertPluginManifest.js';
|
|
24
|
-
import { assertRuntimeManifest } from '../shared/assertRuntimeManifest.js';
|
|
25
24
|
import pc from '@brillout/picocolors';
|
|
26
|
-
import { resolveBaseFromResolvedConfig } from '../shared/resolveBase.js';
|
|
27
25
|
import { loadPageRoutes } from '../../shared/route/loadPageRoutes.js';
|
|
28
26
|
import { assertV1Design } from '../shared/assertV1Design.js';
|
|
29
27
|
const debug = createDebugger('vike:globalContext');
|
|
@@ -141,7 +139,7 @@ async function initGlobalContext(isProduction) {
|
|
|
141
139
|
assert(viteDevServer);
|
|
142
140
|
assert(!isPrerendering);
|
|
143
141
|
const { globalConfig, userFiles } = await getPageRuntimeInfo(isProduction);
|
|
144
|
-
const
|
|
142
|
+
const viteConfigRuntime = getViteConfigRuntime(viteConfig);
|
|
145
143
|
globalObject.globalContext = {
|
|
146
144
|
isProduction: false,
|
|
147
145
|
isPrerendering: false,
|
|
@@ -152,20 +150,14 @@ async function initGlobalContext(isProduction) {
|
|
|
152
150
|
global: globalConfig
|
|
153
151
|
},
|
|
154
152
|
...userFiles,
|
|
155
|
-
|
|
156
|
-
baseAssets: pluginManifest.baseAssets,
|
|
157
|
-
includeAssetsImportedByServer: pluginManifest.includeAssetsImportedByServer,
|
|
158
|
-
trailingSlash: pluginManifest.trailingSlash,
|
|
159
|
-
disableUrlNormalization: pluginManifest.disableUrlNormalization
|
|
153
|
+
viteConfigRuntime
|
|
160
154
|
};
|
|
161
155
|
}
|
|
162
156
|
else {
|
|
163
157
|
const buildEntry = await getBuildEntry(globalObject.outDirRoot, isPrerendering);
|
|
164
|
-
const { assetsManifest,
|
|
158
|
+
const { assetsManifest, buildInfo } = buildEntry;
|
|
165
159
|
setPageFiles(buildEntry.pageFiles);
|
|
166
160
|
const { globalConfig, userFiles } = await getPageRuntimeInfo(isProduction);
|
|
167
|
-
assertViteManifest(assetsManifest);
|
|
168
|
-
assertPluginManifest(pluginManifest);
|
|
169
161
|
const globalContext = {
|
|
170
162
|
isProduction: true,
|
|
171
163
|
assetsManifest,
|
|
@@ -174,12 +166,8 @@ async function initGlobalContext(isProduction) {
|
|
|
174
166
|
},
|
|
175
167
|
...userFiles,
|
|
176
168
|
viteDevServer: null,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
includeAssetsImportedByServer: pluginManifest.includeAssetsImportedByServer,
|
|
180
|
-
trailingSlash: pluginManifest.trailingSlash,
|
|
181
|
-
usesClientRouter: pluginManifest.usesClientRouter,
|
|
182
|
-
disableUrlNormalization: pluginManifest.disableUrlNormalization
|
|
169
|
+
viteConfigRuntime: buildInfo.viteConfigRuntime,
|
|
170
|
+
usesClientRouter: buildInfo.usesClientRouter
|
|
183
171
|
};
|
|
184
172
|
if (isPrerendering) {
|
|
185
173
|
assert(viteConfig);
|
|
@@ -214,19 +202,6 @@ async function getPageRuntimeInfo(isProduction) {
|
|
|
214
202
|
pageConfigs.length > 0, pageFilesAll);
|
|
215
203
|
return { userFiles, globalConfig };
|
|
216
204
|
}
|
|
217
|
-
function getRuntimeManifest(vikeConfigGlobal, viteConfig) {
|
|
218
|
-
const { includeAssetsImportedByServer, trailingSlash, disableUrlNormalization } = vikeConfigGlobal;
|
|
219
|
-
const { baseServer, baseAssets } = resolveBaseFromResolvedConfig(vikeConfigGlobal.baseServer, vikeConfigGlobal.baseAssets, viteConfig);
|
|
220
|
-
const manifest = {
|
|
221
|
-
baseServer,
|
|
222
|
-
baseAssets,
|
|
223
|
-
includeAssetsImportedByServer,
|
|
224
|
-
trailingSlash,
|
|
225
|
-
disableUrlNormalization
|
|
226
|
-
};
|
|
227
|
-
assertRuntimeManifest(manifest);
|
|
228
|
-
return manifest;
|
|
229
|
-
}
|
|
230
205
|
function assertViteManifest(manifest) {
|
|
231
206
|
assert(isPlainObject(manifest));
|
|
232
207
|
/* We should include these assertions but we don't as a workaround for PWA manifests: https://github.com/vikejs/vike/issues/769
|
|
@@ -259,17 +234,48 @@ async function getBuildEntry(outDir, isPrerendering) {
|
|
|
259
234
|
assert(globalObject.buildEntry);
|
|
260
235
|
}
|
|
261
236
|
const { buildEntry } = globalObject;
|
|
262
|
-
|
|
263
|
-
assert(hasProp(buildEntry, 'pageFiles', 'object'));
|
|
264
|
-
assert(hasProp(buildEntry, 'assetsManifest', 'object'));
|
|
265
|
-
assert(hasProp(buildEntry, 'pluginManifest', 'object'));
|
|
237
|
+
assertBuildEntry(buildEntry);
|
|
266
238
|
return buildEntry;
|
|
267
239
|
}
|
|
268
240
|
function setGlobalContext_buildEntry(buildEntry) {
|
|
269
241
|
debug('setGlobalContext_buildEntry()');
|
|
242
|
+
assertBuildEntry(buildEntry);
|
|
270
243
|
globalObject.buildEntry = buildEntry;
|
|
271
244
|
globalObject.buildEntryPrevious = buildEntry;
|
|
272
245
|
}
|
|
246
|
+
function assertBuildEntry(buildEntry) {
|
|
247
|
+
assert(isObject(buildEntry));
|
|
248
|
+
assert(hasProp(buildEntry, 'pageFiles', 'object'));
|
|
249
|
+
const { pageFiles } = buildEntry;
|
|
250
|
+
assert(hasProp(buildEntry, 'assetsManifest', 'object'));
|
|
251
|
+
const { assetsManifest } = buildEntry;
|
|
252
|
+
assertViteManifest(assetsManifest);
|
|
253
|
+
assert(hasProp(buildEntry, 'buildInfo', 'object'));
|
|
254
|
+
const { buildInfo } = buildEntry;
|
|
255
|
+
assertBuildInfo(buildInfo);
|
|
256
|
+
checkType({ pageFiles, assetsManifest, buildInfo });
|
|
257
|
+
}
|
|
258
|
+
function assertBuildInfo(buildInfo) {
|
|
259
|
+
assert(isObject(buildInfo));
|
|
260
|
+
assert(hasProp(buildInfo, 'versionAtBuildTime', 'string'));
|
|
261
|
+
assertVersionAtBuildTime(buildInfo.versionAtBuildTime);
|
|
262
|
+
assert(hasProp(buildInfo, 'viteConfigRuntime', 'object'));
|
|
263
|
+
assert(hasProp(buildInfo.viteConfigRuntime, '_baseViteOriginal', 'string'));
|
|
264
|
+
assert(hasProp(buildInfo, 'usesClientRouter', 'boolean'));
|
|
265
|
+
checkType({ ...buildInfo, viteConfigRuntime: buildInfo.viteConfigRuntime });
|
|
266
|
+
}
|
|
267
|
+
function assertVersionAtBuildTime(versionAtBuildTime) {
|
|
268
|
+
const versionAtRuntime = projectInfo.projectVersion;
|
|
269
|
+
const pretty = (version) => pc.bold(`vike@${version}`);
|
|
270
|
+
assertUsage(versionAtBuildTime === versionAtRuntime, `Re-build your app (you're using ${pretty(versionAtRuntime)} but your app was built with ${pretty(versionAtBuildTime)})`);
|
|
271
|
+
}
|
|
272
|
+
function getViteConfigRuntime(viteConfig) {
|
|
273
|
+
assert(hasProp(viteConfig, '_baseViteOriginal', 'string'));
|
|
274
|
+
const viteConfigRuntime = {
|
|
275
|
+
_baseViteOriginal: viteConfig._baseViteOriginal
|
|
276
|
+
};
|
|
277
|
+
return viteConfigRuntime;
|
|
278
|
+
}
|
|
273
279
|
function initDevEntry() {
|
|
274
280
|
setPageFilesAsync(getPageFilesExports);
|
|
275
281
|
}
|
|
@@ -37,7 +37,7 @@ declare function prerenderPage(pageContext: PageContextInitEnhanced & PageFiles
|
|
|
37
37
|
} & {
|
|
38
38
|
_objectCreatedByVike: boolean;
|
|
39
39
|
_baseServer: string;
|
|
40
|
-
_baseAssets: string
|
|
40
|
+
_baseAssets: string;
|
|
41
41
|
_includeAssetsImportedByServer: boolean;
|
|
42
42
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
43
43
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -88,7 +88,7 @@ declare function prerenderPage(pageContext: PageContextInitEnhanced & PageFiles
|
|
|
88
88
|
} & {
|
|
89
89
|
_objectCreatedByVike: boolean;
|
|
90
90
|
_baseServer: string;
|
|
91
|
-
_baseAssets: string
|
|
91
|
+
_baseAssets: string;
|
|
92
92
|
_includeAssetsImportedByServer: boolean;
|
|
93
93
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
94
94
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -140,7 +140,7 @@ declare function prerender404Page(pageContextInit_: Record<string, unknown> | nu
|
|
|
140
140
|
} & {
|
|
141
141
|
_objectCreatedByVike: boolean;
|
|
142
142
|
_baseServer: string;
|
|
143
|
-
_baseAssets: string
|
|
143
|
+
_baseAssets: string;
|
|
144
144
|
_includeAssetsImportedByServer: boolean;
|
|
145
145
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
146
146
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -191,7 +191,7 @@ declare function prerender404Page(pageContextInit_: Record<string, unknown> | nu
|
|
|
191
191
|
} & {
|
|
192
192
|
_objectCreatedByVike: boolean;
|
|
193
193
|
_baseServer: string;
|
|
194
|
-
_baseAssets: string
|
|
194
|
+
_baseAssets: string;
|
|
195
195
|
_includeAssetsImportedByServer: boolean;
|
|
196
196
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
197
197
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -251,7 +251,7 @@ declare function getPageContextInitEnhanced(pageContextInit: {
|
|
|
251
251
|
} & {
|
|
252
252
|
_objectCreatedByVike: boolean;
|
|
253
253
|
_baseServer: string;
|
|
254
|
-
_baseAssets: string
|
|
254
|
+
_baseAssets: string;
|
|
255
255
|
_includeAssetsImportedByServer: boolean;
|
|
256
256
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
257
257
|
_pageConfigs: import("../../../__internal/index.js").PageConfig[];
|
|
@@ -18,6 +18,7 @@ import { preparePageContextForUserConsumptionServerSide } from './preparePageCon
|
|
|
18
18
|
import { executeGuardHook } from '../../../shared/route/executeGuardHook.js';
|
|
19
19
|
import pc from '@brillout/picocolors';
|
|
20
20
|
import { isServerSideError } from '../../../shared/misc/isServerSideError.js';
|
|
21
|
+
import { resolveBaseRuntime } from '../../shared/resolveBase.js';
|
|
21
22
|
async function renderPageAlreadyRouted(pageContext) {
|
|
22
23
|
// pageContext.pageId can either be the:
|
|
23
24
|
// - ID of the page matching the routing, or the
|
|
@@ -114,14 +115,16 @@ function getPageContextInitEnhanced(pageContextInit, { ssr: { urlRewrite, urlHan
|
|
|
114
115
|
} } = {}) {
|
|
115
116
|
assert(pageContextInit.urlOriginal);
|
|
116
117
|
const globalContext = getGlobalContext();
|
|
118
|
+
const { baseServer, baseAssets } = resolveBaseRuntime();
|
|
117
119
|
const pageContextInitEnhanced = {};
|
|
118
120
|
objectAssign(pageContextInitEnhanced, pageContextInit);
|
|
119
121
|
objectAssign(pageContextInitEnhanced, {
|
|
120
122
|
_objectCreatedByVike: true,
|
|
121
123
|
// The following is defined on `pageContext` because we can eventually make these non-global
|
|
122
|
-
_baseServer:
|
|
123
|
-
_baseAssets:
|
|
124
|
-
|
|
124
|
+
_baseServer: baseServer,
|
|
125
|
+
_baseAssets: baseAssets,
|
|
126
|
+
// TODO/now: add meta.default
|
|
127
|
+
_includeAssetsImportedByServer: globalContext.vikeConfig.global.config.includeAssetsImportedByServer ?? true,
|
|
125
128
|
// TODO: use GloablContext instead
|
|
126
129
|
_pageFilesAll: globalContext.pageFilesAll,
|
|
127
130
|
_pageConfigs: globalContext.pageConfigs,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { resolveRedirects };
|
|
2
2
|
export { resolveRouteStringRedirect };
|
|
3
|
+
export { redirectsErrPrefix };
|
|
4
|
+
declare const redirectsErrPrefix = "[+redirects]";
|
|
3
5
|
declare function resolveRedirects(redirectsAll: Record<string, string>[], urlPathname: string): null | string;
|
|
4
6
|
declare function resolveRouteStringRedirect(urlSource: string, urlTarget: string, urlPathname: string): null | string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export { resolveRedirects };
|
|
2
2
|
// For ./resolveRedirects.spec.ts
|
|
3
3
|
export { resolveRouteStringRedirect };
|
|
4
|
+
export { redirectsErrPrefix };
|
|
4
5
|
import { assertIsNotBrowser } from '../../../utils/assertIsNotBrowser.js';
|
|
5
6
|
import { assert, assertUsage, assertUsageUrlRedirectTarget, isUrlRedirectTarget } from '../../../shared/utils.js';
|
|
6
7
|
import { resolveUrlPathname } from '../../../shared/route/resolveUrlPathname.js';
|
|
7
8
|
import { assertRouteString, resolveRouteString } from '../../../shared/route/resolveRouteString.js';
|
|
8
9
|
import pc from '@brillout/picocolors';
|
|
9
10
|
assertIsNotBrowser(); // Don't bloat the client
|
|
10
|
-
|
|
11
|
-
const configSrc = '[vite.config.js > vike({ redirects })]';
|
|
11
|
+
const redirectsErrPrefix = '[+redirects]';
|
|
12
12
|
function resolveRedirects(redirectsAll, urlPathname) {
|
|
13
13
|
const redirects = merge(redirectsAll);
|
|
14
14
|
for (const [urlSource, urlTarget] of Object.entries(redirects)) {
|
|
@@ -19,9 +19,9 @@ function resolveRedirects(redirectsAll, urlPathname) {
|
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
21
|
function resolveRouteStringRedirect(urlSource, urlTarget, urlPathname) {
|
|
22
|
-
assertRouteString(urlSource, `${
|
|
22
|
+
assertRouteString(urlSource, `${redirectsErrPrefix} Invalid`);
|
|
23
23
|
// Is allowing any protocol a safety issue? https://github.com/vikejs/vike/pull/1292#issuecomment-1828043917
|
|
24
|
-
assertUsageUrlRedirectTarget(urlTarget, `${
|
|
24
|
+
assertUsageUrlRedirectTarget(urlTarget, `${redirectsErrPrefix} The URL redirection target`, true);
|
|
25
25
|
assertParams(urlSource, urlTarget);
|
|
26
26
|
const match = resolveRouteString(urlSource, urlPathname);
|
|
27
27
|
if (!match)
|
|
@@ -37,7 +37,7 @@ function assertParams(urlSource, urlTarget) {
|
|
|
37
37
|
routeSegments.forEach((routeSegment) => {
|
|
38
38
|
if (routeSegment.startsWith('@') || routeSegment.startsWith('*')) {
|
|
39
39
|
const segments = urlSource.split('/');
|
|
40
|
-
assertUsage(segments.includes(routeSegment), `${
|
|
40
|
+
assertUsage(segments.includes(routeSegment), `${redirectsErrPrefix} The redirection source URL ${pc.string(urlSource)} is missing the URL parameter ${pc.string(routeSegment)} used by the redirection target URL ${pc.string(urlTarget)}`);
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
}
|
|
@@ -18,6 +18,7 @@ import { getErrorPageId } from '../../shared/error-page.js';
|
|
|
18
18
|
import { handleErrorWithoutErrorPage } from './renderPage/handleErrorWithoutErrorPage.js';
|
|
19
19
|
import { loadUserFilesServerSide } from './renderPage/loadUserFilesServerSide.js';
|
|
20
20
|
import { resolveRedirects } from './renderPage/resolveRedirects.js';
|
|
21
|
+
import { resolveBaseRuntime } from '../shared/resolveBase.js';
|
|
21
22
|
const globalObject = getGlobalObject('runtime/renderPage.ts', {
|
|
22
23
|
httpRequestsCount: 0
|
|
23
24
|
});
|
|
@@ -336,14 +337,16 @@ function assertIsNotViteRequest(urlPathname, urlOriginal) {
|
|
|
336
337
|
assertUsage(false, `${pc.code('renderPage(pageContextInit)')} called with ${pc.code(`pageContextInit.urlOriginal===${JSON.stringify(urlOriginal)}`)} which is unexpected because the URL ${pc.bold(urlOriginal)} should have already been handled by the development middleware: make sure the ${pc.cyan('createDevMiddleware()')} middleware is executed *before* the ${pc.cyan('renderPage()')} middleware, see ${pc.underline('https://vike.dev/renderPage')}`);
|
|
337
338
|
}
|
|
338
339
|
function normalizeUrl(pageContextInit, httpRequestId) {
|
|
339
|
-
const
|
|
340
|
+
const globalContext = getGlobalContext();
|
|
341
|
+
const { baseServer } = resolveBaseRuntime();
|
|
342
|
+
const { trailingSlash, disableUrlNormalization } = globalContext.vikeConfig.global.config;
|
|
340
343
|
if (disableUrlNormalization)
|
|
341
344
|
return null;
|
|
342
345
|
const { urlOriginal } = pageContextInit;
|
|
343
346
|
const { isPageContextRequest } = handlePageContextRequestUrl(urlOriginal);
|
|
344
347
|
if (isPageContextRequest)
|
|
345
348
|
return null;
|
|
346
|
-
const urlNormalized = normalizeUrlPathname(urlOriginal, trailingSlash, baseServer);
|
|
349
|
+
const urlNormalized = normalizeUrlPathname(urlOriginal, trailingSlash ?? false, baseServer);
|
|
347
350
|
if (!urlNormalized)
|
|
348
351
|
return null;
|
|
349
352
|
logRuntimeInfo?.(`URL normalized from ${pc.cyan(urlOriginal)} to ${pc.cyan(urlNormalized)} (https://vike.dev/url-normalization)`, httpRequestId, 'info');
|
|
@@ -354,7 +357,8 @@ function normalizeUrl(pageContextInit, httpRequestId) {
|
|
|
354
357
|
}
|
|
355
358
|
function getPermanentRedirect(pageContextInit, httpRequestId) {
|
|
356
359
|
const globalContext = getGlobalContext();
|
|
357
|
-
const
|
|
360
|
+
const { baseServer } = resolveBaseRuntime();
|
|
361
|
+
const urlWithoutBase = removeBaseServer(pageContextInit.urlOriginal, baseServer);
|
|
358
362
|
let origin = null;
|
|
359
363
|
let urlTargetExternal = null;
|
|
360
364
|
let urlTarget = modifyUrlPathname(urlWithoutBase, (urlPathname) => {
|
|
@@ -385,8 +389,9 @@ function getPermanentRedirect(pageContextInit, httpRequestId) {
|
|
|
385
389
|
}
|
|
386
390
|
if (normalize(urlTarget) === normalize(urlWithoutBase))
|
|
387
391
|
return null;
|
|
392
|
+
const { baseServer } = resolveBaseRuntime();
|
|
388
393
|
if (!originChanged)
|
|
389
|
-
urlTarget = prependBase(urlTarget,
|
|
394
|
+
urlTarget = prependBase(urlTarget, baseServer);
|
|
390
395
|
assert(urlTarget !== pageContextInit.urlOriginal);
|
|
391
396
|
}
|
|
392
397
|
logRuntimeInfo?.(`Permanent redirection defined by config.redirects (https://vike.dev/redirects)`, httpRequestId, 'info');
|
|
@@ -451,7 +456,7 @@ pageContextNominalPageInit, httpRequestId, pageContextErrorPageInit) {
|
|
|
451
456
|
return { pageContextAbort };
|
|
452
457
|
}
|
|
453
458
|
function assertBaseUrl(pageContextInit) {
|
|
454
|
-
const { baseServer } =
|
|
459
|
+
const { baseServer } = resolveBaseRuntime();
|
|
455
460
|
const { urlOriginal } = pageContextInit;
|
|
456
461
|
const { urlWithoutPageContextRequestSuffix } = handlePageContextRequestUrl(urlOriginal);
|
|
457
462
|
const { hasBaseServer } = parseUrl(urlWithoutPageContextRequestSuffix, baseServer);
|
|
@@ -21,8 +21,8 @@ export * from '../../utils/compareString.js';
|
|
|
21
21
|
export * from '../../utils/isObjectWithKeys.js';
|
|
22
22
|
export * from '../../utils/stringifyStringArray.js';
|
|
23
23
|
export * from '../../utils/unique.js';
|
|
24
|
-
export * from '../../utils/
|
|
25
|
-
export * from '
|
|
24
|
+
export * from '../../utils/toPosixPath.js';
|
|
25
|
+
export * from '../plugin/getOutDirs.js';
|
|
26
26
|
export * from '../../utils/capitalizeFirstLetter.js';
|
|
27
27
|
export * from '../../utils/debugGlob.js';
|
|
28
28
|
export * from '../../utils/isSameErrorMessage.js';
|
|
@@ -25,8 +25,8 @@ export * from '../../utils/compareString.js';
|
|
|
25
25
|
export * from '../../utils/isObjectWithKeys.js';
|
|
26
26
|
export * from '../../utils/stringifyStringArray.js';
|
|
27
27
|
export * from '../../utils/unique.js';
|
|
28
|
-
export * from '../../utils/
|
|
29
|
-
export * from '
|
|
28
|
+
export * from '../../utils/toPosixPath.js';
|
|
29
|
+
export * from '../plugin/getOutDirs.js';
|
|
30
30
|
export * from '../../utils/capitalizeFirstLetter.js';
|
|
31
31
|
export * from '../../utils/debugGlob.js';
|
|
32
32
|
export * from '../../utils/isSameErrorMessage.js';
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
export { resolveBase };
|
|
2
|
+
export { resolveBaseRuntime };
|
|
2
3
|
export { resolveBaseFromResolvedConfig };
|
|
3
4
|
import type { ResolvedConfig } from 'vite';
|
|
4
5
|
declare function resolveBaseFromResolvedConfig(baseServer: string | null, baseAssets: string | null, config: ResolvedConfig): {
|
|
5
6
|
baseServer: string;
|
|
6
7
|
baseAssets: string;
|
|
7
8
|
};
|
|
8
|
-
|
|
9
|
+
type BaseUrlsResolved = {
|
|
9
10
|
baseServer: string;
|
|
10
11
|
baseAssets: string;
|
|
11
12
|
};
|
|
13
|
+
declare function resolveBaseRuntime(): BaseUrlsResolved;
|
|
14
|
+
declare function resolveBase(baseViteOriginal: string | null, baseServerUnresolved: string | null, baseAssetsUnresolved: string | null): BaseUrlsResolved;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
export { resolveBase };
|
|
2
|
+
export { resolveBaseRuntime };
|
|
2
3
|
export { resolveBaseFromResolvedConfig };
|
|
3
4
|
import { assert, assertUsage, isBaseServer, isBaseAssets } from './utils.js';
|
|
4
5
|
import pc from '@brillout/picocolors';
|
|
6
|
+
import { getGlobalContext } from '../runtime/globalContext.js';
|
|
5
7
|
function resolveBaseFromResolvedConfig(baseServer, baseAssets, config) {
|
|
6
8
|
let baseViteOriginal = config._baseViteOriginal;
|
|
7
9
|
assert(baseViteOriginal === null || typeof baseViteOriginal == 'string');
|
|
8
10
|
return resolveBase(baseViteOriginal, baseServer, baseAssets);
|
|
9
11
|
}
|
|
12
|
+
function resolveBaseRuntime() {
|
|
13
|
+
const globalContext = getGlobalContext();
|
|
14
|
+
const baseViteOriginal = globalContext.viteConfigRuntime._baseViteOriginal;
|
|
15
|
+
const baseServerUnresolved = globalContext.vikeConfig.global.config.baseServer ?? null;
|
|
16
|
+
const baseAssetsUnresolved = globalContext.vikeConfig.global.config.baseAssets ?? null;
|
|
17
|
+
return resolveBase(baseViteOriginal, baseServerUnresolved, baseAssetsUnresolved);
|
|
18
|
+
}
|
|
10
19
|
function resolveBase(baseViteOriginal, baseServerUnresolved, baseAssetsUnresolved) {
|
|
11
20
|
if (baseViteOriginal === '/__UNSET__')
|
|
12
21
|
baseViteOriginal = null;
|
|
@@ -37,7 +37,7 @@ import type { PrefetchSetting, PrefetchStaticAssets } from '../../client/client-
|
|
|
37
37
|
import type { ConfigDefinition } from '../../node/plugin/plugins/importUserCode/v1-design/getVikeConfig/configDefinitionsBuiltIn.js';
|
|
38
38
|
import type { DocumentHtml } from '../../node/runtime/html/renderHtml.js';
|
|
39
39
|
import type { InjectFilterEntry } from '../../types/index.js';
|
|
40
|
-
import type { VikeVitePluginOptions } from '../../node/plugin/
|
|
40
|
+
import type { VikeVitePluginOptions } from '../../node/plugin/index.js';
|
|
41
41
|
import type { Vike, VikePackages } from '../VikeNamespace.js';
|
|
42
42
|
import type { HooksTimeoutProvidedByUser } from '../hooks/getHook.js';
|
|
43
43
|
import type { PageContextClient, PageContextServer } from '../types.js';
|
|
@@ -246,11 +246,55 @@ type ConfigBuiltIn = {
|
|
|
246
246
|
*/
|
|
247
247
|
guard?: GuardAsync | GuardSync | ImportString;
|
|
248
248
|
/**
|
|
249
|
-
*
|
|
249
|
+
* Pre-render page(s).
|
|
250
250
|
*
|
|
251
251
|
* https://vike.dev/pre-rendering
|
|
252
|
+
* https://vike.dev/prerender
|
|
253
|
+
*
|
|
254
|
+
* @default false
|
|
252
255
|
*/
|
|
253
|
-
prerender?: boolean | ImportString
|
|
256
|
+
prerender?: boolean | ImportString | {
|
|
257
|
+
/**
|
|
258
|
+
* Allow only some of your pages to be pre-rendered.
|
|
259
|
+
*
|
|
260
|
+
* This setting doesn't affect the pre-rendering process: it merely suppresses the warnings when some of your pages cannot be pre-rendered.
|
|
261
|
+
*
|
|
262
|
+
* https://vike.dev/prerender#partial
|
|
263
|
+
*
|
|
264
|
+
* @default false
|
|
265
|
+
*/
|
|
266
|
+
partial?: boolean;
|
|
267
|
+
/**
|
|
268
|
+
* Don't create a new directory for each HTML file.
|
|
269
|
+
*
|
|
270
|
+
* For example, generate `dist/client/about.html` instead of `dist/client/about/index.html`.
|
|
271
|
+
*
|
|
272
|
+
* https://vike.dev/prerender#noextradir
|
|
273
|
+
*
|
|
274
|
+
* @default false
|
|
275
|
+
*/
|
|
276
|
+
noExtraDir?: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* Number of concurrent pre-render jobs.
|
|
279
|
+
*
|
|
280
|
+
* Set to `false` to disable concurrency.
|
|
281
|
+
*
|
|
282
|
+
* https://vike.dev/prerender#parallel
|
|
283
|
+
*
|
|
284
|
+
* @default os.cpus().length
|
|
285
|
+
*/
|
|
286
|
+
parallel?: boolean | number;
|
|
287
|
+
/**
|
|
288
|
+
* Disable the automatic initiation of the pre-rendering process when running `$ vike build`.
|
|
289
|
+
*
|
|
290
|
+
* Use this if you want to programmatically initiate the pre-rendering process instead.
|
|
291
|
+
*
|
|
292
|
+
* https://vike.dev/prerender#disableautorun
|
|
293
|
+
*
|
|
294
|
+
* @default false
|
|
295
|
+
*/
|
|
296
|
+
disableAutoRun?: boolean;
|
|
297
|
+
};
|
|
254
298
|
/**
|
|
255
299
|
* Install Vike extensions.
|
|
256
300
|
*
|
|
@@ -358,6 +402,34 @@ type ConfigBuiltIn = {
|
|
|
358
402
|
* https://vike.dev/redirects
|
|
359
403
|
*/
|
|
360
404
|
redirects?: Record<string, string>;
|
|
405
|
+
/** Whether URLs should end with a trailing slash.
|
|
406
|
+
*
|
|
407
|
+
* https://vike.dev/url-normalization
|
|
408
|
+
*
|
|
409
|
+
* @default false
|
|
410
|
+
*/
|
|
411
|
+
trailingSlash?: boolean;
|
|
412
|
+
/** Disable automatic URL normalization.
|
|
413
|
+
*
|
|
414
|
+
* https://vike.dev/url-normalization
|
|
415
|
+
*
|
|
416
|
+
* @default false
|
|
417
|
+
*/
|
|
418
|
+
disableUrlNormalization?: boolean;
|
|
419
|
+
/** @deprecated It's now `true` by default. You can remove this option. */
|
|
420
|
+
includeAssetsImportedByServer?: boolean;
|
|
421
|
+
/** @deprecated See https://vike.dev/disableAutoFullBuild */
|
|
422
|
+
disableAutoFullBuild?: boolean | 'prerender';
|
|
423
|
+
/** The Base URL of your server.
|
|
424
|
+
*
|
|
425
|
+
* https://vike.dev/base-url
|
|
426
|
+
*/
|
|
427
|
+
baseServer?: string;
|
|
428
|
+
/** The Base URL of your static assets.
|
|
429
|
+
*
|
|
430
|
+
* https://vike.dev/base-url
|
|
431
|
+
*/
|
|
432
|
+
baseAssets?: string;
|
|
361
433
|
/**
|
|
362
434
|
* @experimental DON'T USE: the API *will* have breaking changes upon any minor version release.
|
|
363
435
|
*
|
|
@@ -407,6 +479,7 @@ type ConfigBuiltIn = {
|
|
|
407
479
|
type ConfigBuiltInResolved = {
|
|
408
480
|
passToClient?: string[][];
|
|
409
481
|
redirects?: Record<string, string>[];
|
|
482
|
+
prerender?: Exclude<Config['prerender'], ImportString | undefined>[];
|
|
410
483
|
};
|
|
411
484
|
type ConfigMeta = Record<string, ConfigDefinition>;
|
|
412
485
|
type ImportString = `import:${string}`;
|