vike 0.4.219 → 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/build.js +23 -58
- package/dist/cjs/node/api/context.js +6 -8
- package/dist/cjs/node/api/prepareViteApiCall.js +6 -7
- package/dist/cjs/node/api/utils.js +1 -1
- package/dist/cjs/node/cli/context.js +16 -0
- package/dist/cjs/node/cli/entry.js +2 -0
- package/dist/cjs/node/cli/utils.js +1 -0
- 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 +43 -31
- 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 +11 -8
- 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/importUserCode/v1-design/getVirtualFilePageConfigs.js +3 -2
- 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 +26 -0
- package/dist/cjs/node/prerender/resolvePrerenderConfig.js +25 -0
- package/dist/cjs/node/prerender/runPrerender.js +64 -37
- package/dist/cjs/node/prerender/utils.js +3 -2
- package/dist/cjs/node/runtime/globalContext.js +44 -58
- package/dist/cjs/node/runtime/page-files/setup.js +1 -1
- 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 +3 -2
- package/dist/cjs/node/shared/resolveBase.js +9 -0
- package/dist/cjs/shared/page-configs/getPageConfigUserFriendly.js +2 -2
- package/dist/cjs/shared/page-configs/loadConfigValues.js +5 -1
- package/dist/cjs/shared/utils.js +1 -1
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assertSetup.js +15 -1
- package/dist/cjs/utils/catchInfiniteLoop.js +34 -0
- package/dist/cjs/utils/findFile.js +3 -3
- package/dist/cjs/utils/isDev.js +4 -1
- package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +2 -2
- package/dist/cjs/utils/makePublicCopy.js +32 -0
- package/dist/cjs/utils/requireResolve.js +3 -3
- package/dist/esm/client/client-routing-runtime/history.d.ts +3 -1
- package/dist/esm/client/client-routing-runtime/history.js +23 -18
- package/dist/esm/client/client-routing-runtime/index.d.ts +0 -1
- package/dist/esm/client/client-routing-runtime/index.js +0 -1
- package/dist/esm/client/client-routing-runtime/initClientRouter.js +2 -2
- package/dist/esm/client/client-routing-runtime/initOnLinkClick.js +3 -4
- package/dist/esm/client/client-routing-runtime/initOnPopState.d.ts +0 -10
- package/dist/esm/client/client-routing-runtime/initOnPopState.js +50 -62
- package/dist/esm/client/client-routing-runtime/renderPageClientSide.js +15 -15
- package/dist/esm/client/client-routing-runtime/scrollRestoration.d.ts +4 -6
- package/dist/esm/client/client-routing-runtime/scrollRestoration.js +17 -12
- package/dist/esm/client/client-routing-runtime/setScrollPosition.d.ts +1 -1
- package/dist/esm/client/client-routing-runtime/setScrollPosition.js +29 -5
- package/dist/esm/client/client-routing-runtime/utils.d.ts +1 -0
- package/dist/esm/client/client-routing-runtime/utils.js +1 -0
- package/dist/esm/client/shared/normalizeClientSideUrl.js +2 -3
- package/dist/esm/node/api/build.d.ts +1 -6
- package/dist/esm/node/api/build.js +20 -25
- package/dist/esm/node/api/context.d.ts +4 -4
- package/dist/esm/node/api/context.js +6 -9
- package/dist/esm/node/api/prepareViteApiCall.d.ts +0 -1
- package/dist/esm/node/api/prepareViteApiCall.js +7 -8
- package/dist/esm/node/api/utils.d.ts +1 -1
- package/dist/esm/node/api/utils.js +1 -1
- package/dist/esm/node/cli/context.d.ts +5 -0
- package/dist/esm/node/cli/context.js +14 -0
- package/dist/esm/node/cli/entry.js +2 -0
- package/dist/esm/node/cli/parseCli.d.ts +3 -1
- package/dist/esm/node/cli/utils.d.ts +1 -0
- package/dist/esm/node/cli/utils.js +1 -0
- 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 +43 -31
- 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 +8 -2
- package/dist/esm/node/plugin/plugins/commonConfig.js +9 -6
- 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/importUserCode/v1-design/getVirtualFilePageConfigs.js +3 -2
- 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 +9 -0
- package/dist/esm/node/prerender/context.js +24 -0
- 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.d.ts +42 -1
- package/dist/esm/node/prerender/runPrerender.js +65 -38
- package/dist/esm/node/prerender/utils.d.ts +3 -2
- package/dist/esm/node/prerender/utils.js +3 -2
- package/dist/esm/node/runtime/globalContext.d.ts +15 -9
- package/dist/esm/node/runtime/globalContext.js +45 -59
- package/dist/esm/node/runtime/page-files/setup.js +1 -1
- 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 +3 -2
- package/dist/esm/node/runtime/utils.js +3 -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 -16
- 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/page-configs/loadConfigValues.js +6 -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/assertSetup.js +15 -1
- package/dist/esm/utils/catchInfiniteLoop.d.ts +2 -0
- package/dist/esm/utils/catchInfiniteLoop.js +32 -0
- package/dist/esm/utils/findFile.js +1 -1
- package/dist/esm/utils/isDev.js +4 -1
- package/dist/esm/utils/isFilePathAbsoluteFilesystem.js +1 -1
- package/dist/esm/utils/makePublicCopy.d.ts +3 -0
- package/dist/esm/utils/makePublicCopy.js +30 -0
- 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/prerender/isPrerenderAutoRunEnabled.js +0 -16
- 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/prerender/isPrerenderAutoRunEnabled.d.ts +0 -5
- package/dist/esm/node/prerender/isPrerenderAutoRunEnabled.js +0 -14
- 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
|
@@ -2,8 +2,12 @@ export { setScrollPosition };
|
|
|
2
2
|
export { autoSaveScrollPosition };
|
|
3
3
|
export { scrollToHashOrTop };
|
|
4
4
|
import { assert, onPageHide, sleep, throttle } from './utils.js';
|
|
5
|
-
import { saveScrollPosition } from './history.js';
|
|
6
|
-
function setScrollPosition(scrollTarget) {
|
|
5
|
+
import { replaceHistoryStateOriginal, saveScrollPosition } from './history.js';
|
|
6
|
+
function setScrollPosition(scrollTarget, url) {
|
|
7
|
+
if (!scrollTarget && url && hasTextFragment(url)) {
|
|
8
|
+
scrollToTextFragment(url);
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
7
11
|
if (scrollTarget && 'x' in scrollTarget) {
|
|
8
12
|
setScroll(scrollTarget);
|
|
9
13
|
return;
|
|
@@ -14,6 +18,21 @@ function setScrollPosition(scrollTarget) {
|
|
|
14
18
|
const hash = getUrlHash();
|
|
15
19
|
scrollToHashOrTop(hash);
|
|
16
20
|
}
|
|
21
|
+
// https://github.com/vikejs/vike/issues/2114
|
|
22
|
+
// https://github.com/WICG/scroll-to-text-fragment/issues/261
|
|
23
|
+
function scrollToTextFragment(url) {
|
|
24
|
+
const stateOriginal = window.history.state;
|
|
25
|
+
replaceHistoryStateOriginal(null, url);
|
|
26
|
+
// We need `history.state===null` before location.replace() so that our 'popstate' handling is correct
|
|
27
|
+
assert(window.history.state === null);
|
|
28
|
+
// - Chrome's location.replace() keeps the current state (`history.state===stateOriginal`)
|
|
29
|
+
// - Firefox's location.replace() replaces the current state with `null` (`history.state===null`)
|
|
30
|
+
window.location.replace(url);
|
|
31
|
+
replaceHistoryStateOriginal(stateOriginal, url);
|
|
32
|
+
}
|
|
33
|
+
function hasTextFragment(url) {
|
|
34
|
+
return url.includes('#') && url.includes(':~:text');
|
|
35
|
+
}
|
|
17
36
|
// Replicates the browser's native behavior
|
|
18
37
|
function scrollToHashOrTop(hash) {
|
|
19
38
|
if (!hash) {
|
|
@@ -45,9 +64,14 @@ function scrollToTop() {
|
|
|
45
64
|
* - Let's remove it and see if users complain?
|
|
46
65
|
*/
|
|
47
66
|
function setScroll(scrollPosition) {
|
|
48
|
-
const scroll = () =>
|
|
49
|
-
|
|
50
|
-
|
|
67
|
+
const scroll = () => {
|
|
68
|
+
// `window.scrollTo()` respects the CSS `scroll-behavior: smooth` property
|
|
69
|
+
window.scrollTo(scrollPosition.x, scrollPosition.y);
|
|
70
|
+
};
|
|
71
|
+
const done = () => {
|
|
72
|
+
return window.scrollX === scrollPosition.x && window.scrollY === scrollPosition.y;
|
|
73
|
+
};
|
|
74
|
+
// In principle, this `done()` call should force the repaint to be finished, but that doesn't seem to be the case with `Firefox 97.0.1`.
|
|
51
75
|
if (done())
|
|
52
76
|
return;
|
|
53
77
|
scroll();
|
|
@@ -2,9 +2,8 @@ export { normalizeClientSideUrl };
|
|
|
2
2
|
import { assert, parseUrl } from './utils.js';
|
|
3
3
|
/** Resolves relative URLs */
|
|
4
4
|
function normalizeClientSideUrl(url, options) {
|
|
5
|
-
// This function doesn't work for `url === '#some-hash'` because `searchOriginal`
|
|
6
|
-
// -
|
|
7
|
-
// - It makes sense that `parseUrl()` returns `searchOriginal === null` since there isn't any search string in `url`.
|
|
5
|
+
// This function doesn't work for `url === '#some-hash'` because `searchOriginal` will be missing: if window.location.href has a search string then it's going to be missing in the returned `urlCurrent` value because `parseUrl(url)` returns `searchOriginal: null` since there isn't any search string in `url`.
|
|
6
|
+
// - Maybe `const { searchOriginal } = parseUrl(window.location.href)` can be a fix. (Let's check how `normalizeClientSideUrl()` is being used.)
|
|
8
7
|
assert(!url.startsWith('#'));
|
|
9
8
|
const { searchOriginal, hashOriginal, pathname } = parseUrl(url, '/');
|
|
10
9
|
let urlCurrent = `${pathname}${searchOriginal || ''}`;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
export { build };
|
|
2
|
-
import { type Rollup } from 'vite';
|
|
3
2
|
import type { APIOptions } from './types.js';
|
|
4
|
-
type RollupOutput = Rollup.RollupOutput | Rollup.RollupOutput[] | Rollup.RollupWatcher;
|
|
5
3
|
/**
|
|
6
4
|
* Programmatically trigger `$ vike build`
|
|
7
5
|
*
|
|
8
6
|
* https://vike.dev/api#build
|
|
9
7
|
*/
|
|
10
|
-
declare function build(options?: APIOptions): Promise<{
|
|
11
|
-
rollupOutputClient: RollupOutput;
|
|
12
|
-
rollupOutputServer: RollupOutput;
|
|
13
|
-
}>;
|
|
8
|
+
declare function build(options?: APIOptions): Promise<{}>;
|
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
export { build };
|
|
2
2
|
import { prepareViteApiCall } from './prepareViteApiCall.js';
|
|
3
3
|
import { build as buildVite } from 'vite';
|
|
4
|
-
import
|
|
4
|
+
import assert from 'assert';
|
|
5
|
+
import { isVikeCli } from '../cli/context.js';
|
|
6
|
+
import { isPrerendering } from '../prerender/context.js';
|
|
5
7
|
/**
|
|
6
8
|
* Programmatically trigger `$ vike build`
|
|
7
9
|
*
|
|
8
10
|
* https://vike.dev/api#build
|
|
9
11
|
*/
|
|
10
12
|
async function build(options = {}) {
|
|
11
|
-
const { viteConfigEnhanced
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const { viteConfigEnhanced } = await prepareViteApiCall(options.viteConfig, 'build');
|
|
14
|
+
// Pass it to autoFullBuild()
|
|
15
|
+
if (viteConfigEnhanced)
|
|
16
|
+
viteConfigEnhanced._viteConfigEnhanced = viteConfigEnhanced;
|
|
17
|
+
// 1. Build client-side
|
|
18
|
+
// 2. Build server-side
|
|
19
|
+
// > See: https://github.com/vikejs/vike/blob/c6c7533a56b3a16fc43ed644fc5c10c02d0ff375/vike/node/plugin/plugins/autoFullBuild.ts#L90
|
|
20
|
+
// 3. Pre-render (if enabled)
|
|
21
|
+
// > See: https://github.com/vikejs/vike/blob/c6c7533a56b3a16fc43ed644fc5c10c02d0ff375/vike/node/plugin/plugins/autoFullBuild.ts#L98
|
|
22
|
+
// > We purposely don't start the pre-rendering in this `build()` function but in a Rollup hook instead.
|
|
23
|
+
// > Rationale: https://github.com/vikejs/vike/issues/2123
|
|
24
|
+
await buildVite(viteConfigEnhanced);
|
|
25
|
+
// When using the Vike CLI with pre-rendering the process is forcefully exited at the end of the buildVite() call above
|
|
26
|
+
assert(!(isVikeCli() && isPrerendering()));
|
|
21
27
|
return {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
rollupOutputClient: outputClient,
|
|
26
|
-
rollupOutputServer: outputServer
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function setSSR(viteConfig) {
|
|
30
|
-
return {
|
|
31
|
-
...viteConfig,
|
|
32
|
-
build: {
|
|
33
|
-
...viteConfig?.build,
|
|
34
|
-
ssr: true
|
|
35
|
-
}
|
|
28
|
+
/* We don't return `viteConfig` because `viteConfigEnhanced` is `InlineConfig` not `ResolvedConfig`
|
|
29
|
+
viteConfig: viteConfigEnhanced,
|
|
30
|
+
*/
|
|
36
31
|
};
|
|
37
32
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { setOperation };
|
|
2
|
-
export { clearOperation };
|
|
3
1
|
export { isVikeCliOrApi };
|
|
2
|
+
export { setContextApiOperation };
|
|
3
|
+
export { clearContextApiOperation };
|
|
4
4
|
import type { Operation } from './types.js';
|
|
5
5
|
declare function isVikeCliOrApi(): boolean;
|
|
6
|
-
declare function
|
|
7
|
-
declare function
|
|
6
|
+
declare function setContextApiOperation(operation: Operation): void;
|
|
7
|
+
declare function clearContextApiOperation(): void;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
// export { getOperation }
|
|
2
|
-
export { setOperation };
|
|
3
|
-
export { clearOperation };
|
|
4
1
|
export { isVikeCliOrApi };
|
|
2
|
+
export { setContextApiOperation };
|
|
3
|
+
export { clearContextApiOperation };
|
|
5
4
|
import { assert, getGlobalObject } from './utils.js';
|
|
6
|
-
const globalObject = getGlobalObject('context.ts', {
|
|
7
|
-
|
|
8
|
-
});
|
|
9
|
-
function getOperation() {
|
|
5
|
+
const globalObject = getGlobalObject('api/context.ts', {});
|
|
6
|
+
function getApiOperation() {
|
|
10
7
|
assert(globalObject.apiOperation);
|
|
11
8
|
return globalObject.apiOperation;
|
|
12
9
|
}
|
|
@@ -14,10 +11,10 @@ function isVikeCliOrApi() {
|
|
|
14
11
|
// The CLI uses the API
|
|
15
12
|
return !!globalObject.apiOperation;
|
|
16
13
|
}
|
|
17
|
-
function
|
|
14
|
+
function setContextApiOperation(operation) {
|
|
18
15
|
assert(!globalObject.apiOperation);
|
|
19
16
|
globalObject.apiOperation = operation;
|
|
20
17
|
}
|
|
21
|
-
function
|
|
18
|
+
function clearContextApiOperation() {
|
|
22
19
|
globalObject.apiOperation = undefined;
|
|
23
20
|
}
|
|
@@ -6,7 +6,6 @@ import type { InlineConfig, ResolvedConfig } from 'vite';
|
|
|
6
6
|
import type { Operation } from './types.js';
|
|
7
7
|
declare function prepareViteApiCall(viteConfig: InlineConfig | undefined, operation: Operation): Promise<{
|
|
8
8
|
viteConfigEnhanced: InlineConfig | undefined;
|
|
9
|
-
vikeConfigGlobal: import("../plugin/plugins/importUserCode/v1-design/getVikeConfig.js").VikeConfigGlobal;
|
|
10
9
|
}>;
|
|
11
10
|
declare function getViteRoot(operation: 'build' | 'dev' | 'preview' | 'prerender'): Promise<string>;
|
|
12
11
|
declare function normalizeViteRoot(root: string): string;
|
|
@@ -4,7 +4,7 @@ export { assertViteRoot };
|
|
|
4
4
|
export { normalizeViteRoot };
|
|
5
5
|
// TODO: enable Vike extensions to add Vite plugins
|
|
6
6
|
import { loadConfigFromFile, mergeConfig, resolveConfig } from 'vite';
|
|
7
|
-
import {
|
|
7
|
+
import { clearContextApiOperation, setContextApiOperation } from './context.js';
|
|
8
8
|
import { getVikeConfig2 } from '../plugin/plugins/importUserCode/v1-design/getVikeConfig.js';
|
|
9
9
|
import path from 'path';
|
|
10
10
|
import { assert, assertUsage, getGlobalObject, isObject, toPosixPath } from './utils.js';
|
|
@@ -13,31 +13,30 @@ import { clearGlobalContext } from '../runtime/globalContext.js';
|
|
|
13
13
|
const globalObject = getGlobalObject('prepareViteApiCall.ts', {});
|
|
14
14
|
async function prepareViteApiCall(viteConfig, operation) {
|
|
15
15
|
clear();
|
|
16
|
-
|
|
16
|
+
setContextApiOperation(operation);
|
|
17
17
|
return enhanceViteConfig(viteConfig, operation);
|
|
18
18
|
}
|
|
19
19
|
// For subsequent API calls, e.g. calling prerender() after build()
|
|
20
20
|
function clear() {
|
|
21
|
-
|
|
21
|
+
clearContextApiOperation();
|
|
22
22
|
clearGlobalContext();
|
|
23
23
|
}
|
|
24
24
|
async function enhanceViteConfig(viteConfig, operation) {
|
|
25
25
|
const viteInfo = await getInfoFromVite(viteConfig, operation);
|
|
26
26
|
await assertViteRoot2(viteInfo.root, viteInfo.viteConfigEnhanced, operation);
|
|
27
27
|
const vikeConfig = await getVikeConfig2(viteInfo.root, operation === 'dev', viteInfo.vikeVitePluginOptions);
|
|
28
|
-
const viteConfigEnhanced =
|
|
28
|
+
const viteConfigEnhanced = addViteSettingsSetByVikeConfig(viteInfo.viteConfigEnhanced, vikeConfig);
|
|
29
29
|
return {
|
|
30
|
-
viteConfigEnhanced
|
|
31
|
-
vikeConfigGlobal: vikeConfig.vikeConfigGlobal
|
|
30
|
+
viteConfigEnhanced
|
|
32
31
|
};
|
|
33
32
|
}
|
|
34
|
-
function
|
|
33
|
+
function addViteSettingsSetByVikeConfig(viteConfigEnhanced, vikeConfig) {
|
|
35
34
|
const viteConfigs = vikeConfig.global.from.configsCumulative.vite;
|
|
36
35
|
if (!viteConfigs)
|
|
37
36
|
return viteConfigEnhanced;
|
|
38
37
|
viteConfigs.values.forEach((v) => {
|
|
39
38
|
assertUsage(isObject(v.value), `${v.definedAt} should be an object`);
|
|
40
|
-
viteConfigEnhanced = mergeConfig(
|
|
39
|
+
viteConfigEnhanced = mergeConfig(viteConfigEnhanced ?? {}, v.value);
|
|
41
40
|
});
|
|
42
41
|
return viteConfigEnhanced;
|
|
43
42
|
}
|
|
@@ -4,5 +4,5 @@ import { onLoad } from './onLoad.js';
|
|
|
4
4
|
onLoad();
|
|
5
5
|
export * from '../../utils/assert.js';
|
|
6
6
|
export * from '../../utils/getGlobalObject.js';
|
|
7
|
-
export * from '../../utils/
|
|
7
|
+
export * from '../../utils/toPosixPath.js';
|
|
8
8
|
export * from '../../utils/isObject.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { isVikeCli };
|
|
2
|
+
export { setContextCliCommand };
|
|
3
|
+
import { assert, getGlobalObject } from './utils.js';
|
|
4
|
+
const globalObject = getGlobalObject('cli/context.ts', {});
|
|
5
|
+
function getCliCommand() {
|
|
6
|
+
return globalObject.cliCommand;
|
|
7
|
+
}
|
|
8
|
+
function isVikeCli() {
|
|
9
|
+
return !!globalObject.cliCommand;
|
|
10
|
+
}
|
|
11
|
+
function setContextCliCommand(command) {
|
|
12
|
+
assert(!globalObject.cliCommand);
|
|
13
|
+
globalObject.cliCommand = command;
|
|
14
|
+
}
|
|
@@ -2,9 +2,11 @@ import { projectInfo } from './utils.js';
|
|
|
2
2
|
import { dev, build, preview } from '../api/index.js';
|
|
3
3
|
import pc from '@brillout/picocolors';
|
|
4
4
|
import { parseCli } from './parseCli.js';
|
|
5
|
+
import { setContextCliCommand } from './context.js';
|
|
5
6
|
cli();
|
|
6
7
|
async function cli() {
|
|
7
8
|
const { command } = parseCli();
|
|
9
|
+
setContextCliCommand(command);
|
|
8
10
|
if (command === 'dev') {
|
|
9
11
|
await cmdDev();
|
|
10
12
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { getOutDirs };
|
|
2
2
|
export { resolveOutDir };
|
|
3
|
-
import { viteIsSSR } from '
|
|
4
|
-
import { assert, assertUsage } from '
|
|
5
|
-
import { pathJoin } from '
|
|
6
|
-
import { assertPosixPath, toPosixPath } from '
|
|
3
|
+
import { viteIsSSR } from '../../utils/viteIsSSR.js';
|
|
4
|
+
import { assert, assertUsage } from '../../utils/assert.js';
|
|
5
|
+
import { pathJoin } from '../../utils/path-shim.js';
|
|
6
|
+
import { assertPosixPath, toPosixPath } from '../../utils/toPosixPath.js';
|
|
7
7
|
import pc from '@brillout/picocolors';
|
|
8
|
-
import { createDebugger } from '
|
|
8
|
+
import { createDebugger } from '../../utils/debug.js';
|
|
9
9
|
const debug = createDebugger('vike:outDir');
|
|
10
10
|
function getOutDirs(config) {
|
|
11
11
|
debug('getOutDirs()', new Error().stack);
|
|
@@ -2,6 +2,34 @@ export default plugin;
|
|
|
2
2
|
export { plugin };
|
|
3
3
|
export { plugin as ssr };
|
|
4
4
|
export type { VikeVitePluginOptions as UserConfig };
|
|
5
|
+
export type { VikeVitePluginOptions };
|
|
5
6
|
export { PROJECT_VERSION as version } from './utils.js';
|
|
6
|
-
import type { VikeVitePluginOptions } from './plugins/importUserCode/v1-design/getVikeConfig.js';
|
|
7
7
|
declare function plugin(vikeVitePluginOptions?: VikeVitePluginOptions): any;
|
|
8
|
+
/** @deprecated Define Vike settings in +config.js instead of vite.config.js */
|
|
9
|
+
type VikeVitePluginOptions = {
|
|
10
|
+
/** @deprecated Define Vike settings in +config.js instead of vite.config.js */
|
|
11
|
+
prerender?: boolean | {
|
|
12
|
+
/** @deprecated Define Vike settings in +config.js instead of vite.config.js */
|
|
13
|
+
noExtraDir?: boolean;
|
|
14
|
+
/** @deprecated Define Vike settings in +config.js instead of vite.config.js */
|
|
15
|
+
parallel?: boolean | number;
|
|
16
|
+
/** @deprecated Define Vike settings in +config.js instead of vite.config.js */
|
|
17
|
+
partial?: boolean;
|
|
18
|
+
/** @deprecated Define Vike settings in +config.js instead of vite.config.js */
|
|
19
|
+
disableAutoRun?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** @deprecated See https://vike.dev/disableAutoFullBuild */
|
|
22
|
+
disableAutoFullBuild?: boolean | 'prerender';
|
|
23
|
+
/** @deprecated Define Vike settings in +config.js instead of vite.config.js */
|
|
24
|
+
baseServer?: string;
|
|
25
|
+
/** @deprecated Define Vike settings in +config.js instead of vite.config.js */
|
|
26
|
+
baseAssets?: string;
|
|
27
|
+
/** @deprecated It's now `true` by default. You can remove this option. */
|
|
28
|
+
includeAssetsImportedByServer?: boolean;
|
|
29
|
+
/** @deprecated Define Vike settings in +config.js instead of vite.config.js */
|
|
30
|
+
redirects?: Record<string, string>;
|
|
31
|
+
/** @deprecated Define Vike settings in +config.js instead of vite.config.js */
|
|
32
|
+
trailingSlash?: boolean;
|
|
33
|
+
/** @deprecated Define Vike settings in +config.js instead of vite.config.js */
|
|
34
|
+
disableUrlNormalization?: boolean;
|
|
35
|
+
};
|
|
@@ -3,8 +3,7 @@ export { plugin };
|
|
|
3
3
|
// TODO/v1-release: remove
|
|
4
4
|
export { plugin as ssr };
|
|
5
5
|
export { PROJECT_VERSION as version } from './utils.js';
|
|
6
|
-
import {
|
|
7
|
-
import { assertUsage, assertVersion, markSetup_vikeVitePlugin } from './utils.js';
|
|
6
|
+
import { assertUsage } from './utils.js';
|
|
8
7
|
import { buildConfig } from './plugins/buildConfig.js';
|
|
9
8
|
import { previewConfig } from './plugins/previewConfig.js';
|
|
10
9
|
import { autoFullBuild } from './plugins/autoFullBuild.js';
|
|
@@ -27,8 +26,7 @@ import { setResolveClientEntriesDev } from '../runtime/renderPage/getPageAssets.
|
|
|
27
26
|
import { resolveClientEntriesDev } from './resolveClientEntriesDev.js';
|
|
28
27
|
import { workaroundCssModuleHmr } from './plugins/workaroundCssModuleHmr.js';
|
|
29
28
|
import { workaroundVite6HmrRegression } from './plugins/workaroundVite6HmrRegression.js';
|
|
30
|
-
|
|
31
|
-
assertViteVersion();
|
|
29
|
+
// We don't call this in ./onLoad.ts to avoid a cyclic dependency with utils.ts
|
|
32
30
|
setResolveClientEntriesDev(resolveClientEntriesDev);
|
|
33
31
|
// Return as `any` to avoid Plugin type mismatches when there are multiple Vite versions installed
|
|
34
32
|
function plugin(vikeVitePluginOptions = {}) {
|
|
@@ -63,10 +61,6 @@ Object.defineProperty(plugin, 'apply', {
|
|
|
63
61
|
assertUsage(false, `Add ${pc.cyan('vike()')} instead of ${pc.cyan('vike')} to vite.config.js#plugins (i.e. call the function and add the return value instead of adding the function itself)`, { showStackTrace: true });
|
|
64
62
|
}
|
|
65
63
|
});
|
|
66
|
-
// package.json#peerDependencies isn't enough as users can ignore it
|
|
67
|
-
function assertViteVersion() {
|
|
68
|
-
assertVersion('Vite', version, '5.1.0');
|
|
69
|
-
}
|
|
70
64
|
// Ensures following works: `const vike = require('vike/plugin')` / `import vike from 'vike/plugin'`
|
|
71
65
|
// - It needs to live at the end of this file, in order to ensure we do it after all assignments to `exports`.
|
|
72
66
|
try {
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
export { onLoad };
|
|
2
2
|
import { assertIsNotBrowser } from '../../utils/assertIsNotBrowser.js';
|
|
3
|
-
import { assertIsNotProductionRuntime } from '../../utils/assertSetup.js';
|
|
3
|
+
import { assertIsNotProductionRuntime, markSetup_vikeVitePlugin } from '../../utils/assertSetup.js';
|
|
4
4
|
import { assertNodeVersion } from '../../utils/assertNodeVersion.js';
|
|
5
|
+
import { assertVersion } from '../../utils/assertVersion.js';
|
|
6
|
+
import { version } from 'vite';
|
|
5
7
|
function onLoad() {
|
|
8
|
+
markSetup_vikeVitePlugin();
|
|
6
9
|
assertIsNotBrowser();
|
|
7
10
|
assertNodeVersion();
|
|
8
|
-
//
|
|
11
|
+
// package.json#peerDependencies isn't enough as users can ignore it
|
|
12
|
+
assertVersion('Vite', version, '5.1.0');
|
|
13
|
+
// Ensure we don't bloat the server runtime with heavy dependencies such Vite and esbuild
|
|
9
14
|
assertIsNotProductionRuntime();
|
|
10
15
|
}
|
|
@@ -3,26 +3,27 @@ export { autoFullBuild };
|
|
|
3
3
|
import { build } from 'vite';
|
|
4
4
|
import { assertWarning } from '../utils.js';
|
|
5
5
|
import { runPrerenderFromAutoRun, runPrerender_forceExit } from '../../prerender/runPrerender.js';
|
|
6
|
-
import { isPrerenderAutoRunEnabled } from '../../prerender/
|
|
6
|
+
import { isPrerenderAutoRunEnabled } from '../../prerender/context.js';
|
|
7
7
|
import { isViteCliCall, getViteConfigFromCli } from '../shared/isViteCliCall.js';
|
|
8
8
|
import pc from '@brillout/picocolors';
|
|
9
9
|
import { logErrorHint } from '../../runtime/renderPage/logErrorHint.js';
|
|
10
10
|
import { manifestTempFile } from './buildConfig.js';
|
|
11
11
|
import { getVikeConfig } from './importUserCode/v1-design/getVikeConfig.js';
|
|
12
|
+
import { isVikeCliOrApi } from '../../api/context.js';
|
|
13
|
+
import { isVikeCli } from '../../cli/context.js';
|
|
12
14
|
let forceExit = false;
|
|
13
15
|
function autoFullBuild() {
|
|
14
16
|
let config;
|
|
15
|
-
let
|
|
17
|
+
let vikeConfig;
|
|
16
18
|
return [
|
|
17
19
|
{
|
|
18
20
|
name: 'vike:autoFullBuild',
|
|
19
21
|
apply: 'build',
|
|
20
22
|
enforce: 'pre',
|
|
21
23
|
async configResolved(config_) {
|
|
22
|
-
|
|
23
|
-
vikeConfigGlobal = vikeConfig.vikeConfigGlobal;
|
|
24
|
+
vikeConfig = await getVikeConfig(config_);
|
|
24
25
|
config = config_;
|
|
25
|
-
abortViteBuildSsr(
|
|
26
|
+
abortViteBuildSsr(vikeConfig);
|
|
26
27
|
},
|
|
27
28
|
writeBundle: {
|
|
28
29
|
/* We can't use this because it breaks Vite's logging. TODO: try again with latest Vite version.
|
|
@@ -31,7 +32,7 @@ function autoFullBuild() {
|
|
|
31
32
|
*/
|
|
32
33
|
async handler(_options, bundle) {
|
|
33
34
|
try {
|
|
34
|
-
await triggerFullBuild(config,
|
|
35
|
+
await triggerFullBuild(config, vikeConfig, bundle);
|
|
35
36
|
}
|
|
36
37
|
catch (err) {
|
|
37
38
|
// Avoid Rollup prefixing the error with [vike:autoFullBuild], for example see https://github.com/vikejs/vike/issues/472#issuecomment-1276274203
|
|
@@ -57,10 +58,10 @@ function autoFullBuild() {
|
|
|
57
58
|
}
|
|
58
59
|
];
|
|
59
60
|
}
|
|
60
|
-
async function triggerFullBuild(config,
|
|
61
|
+
async function triggerFullBuild(config, vikeConfig, bundle) {
|
|
61
62
|
if (config.build.ssr)
|
|
62
63
|
return; // already triggered
|
|
63
|
-
if (isDisabled(
|
|
64
|
+
if (isDisabled(vikeConfig))
|
|
64
65
|
return;
|
|
65
66
|
// Workaround for @vitejs/plugin-legacy
|
|
66
67
|
// - The legacy plugin triggers its own Rollup build for the client-side.
|
|
@@ -69,43 +70,54 @@ async function triggerFullBuild(config, vikeConfigGlobal, bundle) {
|
|
|
69
70
|
if (!bundle[manifestTempFile])
|
|
70
71
|
return;
|
|
71
72
|
const configFromCli = !isViteCliCall() ? null : getViteConfigFromCli();
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
await build({
|
|
82
|
-
...configInline,
|
|
73
|
+
let configInline;
|
|
74
|
+
if (config._viteConfigEnhanced) {
|
|
75
|
+
configInline = config._viteConfigEnhanced;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
configInline = {
|
|
79
|
+
...configFromCli,
|
|
80
|
+
configFile: configFromCli?.configFile || config.configFile,
|
|
81
|
+
root: config.root,
|
|
83
82
|
build: {
|
|
84
|
-
...
|
|
85
|
-
ssr: true
|
|
83
|
+
...configFromCli?.build
|
|
86
84
|
}
|
|
87
|
-
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
await build(setSSR(configInline));
|
|
88
89
|
}
|
|
89
90
|
catch (err) {
|
|
90
91
|
console.error(err);
|
|
91
92
|
logErrorHint(err);
|
|
92
93
|
process.exit(1);
|
|
93
94
|
}
|
|
94
|
-
if (isPrerenderAutoRunEnabled(
|
|
95
|
-
await runPrerenderFromAutoRun(configInline);
|
|
96
|
-
|
|
95
|
+
if (isPrerenderAutoRunEnabled(vikeConfig)) {
|
|
96
|
+
const { prerenderContextPublic } = await runPrerenderFromAutoRun(configInline);
|
|
97
|
+
config.vike.prerenderContext = prerenderContextPublic;
|
|
98
|
+
forceExit = isVikeCli() || isViteCliCall();
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
+
function setSSR(configInline) {
|
|
102
|
+
return {
|
|
103
|
+
...configInline,
|
|
104
|
+
build: {
|
|
105
|
+
...configInline.build,
|
|
106
|
+
ssr: true
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function abortViteBuildSsr(vikeConfig) {
|
|
111
|
+
if (vikeConfig.global.config.disableAutoFullBuild !== true && isViteCliCall() && getViteConfigFromCli()?.build.ssr) {
|
|
101
112
|
assertWarning(false, `The CLI call ${pc.cyan('$ vite build --ssr')} is superfluous since ${pc.cyan('$ vite build')} also builds the server-side. If you want two separate build steps then use https://vike.dev/disableAutoFullBuild or use Vite's ${pc.cyan('build()')} API.`, { onlyOnce: true });
|
|
102
113
|
process.exit(0);
|
|
103
114
|
}
|
|
104
115
|
}
|
|
105
|
-
function isDisabled(
|
|
106
|
-
const { disableAutoFullBuild } =
|
|
107
|
-
if (disableAutoFullBuild ===
|
|
108
|
-
|
|
116
|
+
function isDisabled(vikeConfig) {
|
|
117
|
+
const { disableAutoFullBuild } = vikeConfig.global.config;
|
|
118
|
+
if (disableAutoFullBuild === undefined || disableAutoFullBuild === 'prerender') {
|
|
119
|
+
const isViteApi = !isViteCliCall() && !isVikeCliOrApi();
|
|
120
|
+
return isViteApi;
|
|
109
121
|
}
|
|
110
122
|
else {
|
|
111
123
|
return disableAutoFullBuild;
|
|
@@ -11,7 +11,7 @@ function baseUrls() {
|
|
|
11
11
|
const isDev = config._isDev;
|
|
12
12
|
assert(typeof isDev === 'boolean');
|
|
13
13
|
const baseViteOriginal = config.base ?? '/__UNSET__'; // '/__UNSET__' because Vite resolves `_baseViteOriginal: null` to `undefined`
|
|
14
|
-
basesResolved = resolveBase(baseViteOriginal, config.vike.
|
|
14
|
+
basesResolved = resolveBase(baseViteOriginal, config.vike.global.config.baseServer ?? null, config.vike.global.config.baseAssets ?? null);
|
|
15
15
|
// We cannot define these in configResolved() because Vite picks up the env variables before any configResolved() hook is called
|
|
16
16
|
process.env.BASE_SERVER = basesResolved.baseServer;
|
|
17
17
|
process.env.BASE_ASSETS = basesResolved.baseAssets;
|
|
@@ -27,7 +27,7 @@ function baseUrls() {
|
|
|
27
27
|
},
|
|
28
28
|
async configResolved(config) {
|
|
29
29
|
const vikeConfig = await getVikeConfig(config);
|
|
30
|
-
const basesResolved2 = resolveBaseFromResolvedConfig(vikeConfig.
|
|
30
|
+
const basesResolved2 = resolveBaseFromResolvedConfig(vikeConfig.global.config.baseServer ?? null, vikeConfig.global.config.baseAssets ?? null, config);
|
|
31
31
|
assert(basesResolved2.baseServer === basesResolved.baseServer);
|
|
32
32
|
assert(basesResolved2.baseAssets === basesResolved.baseAssets);
|
|
33
33
|
/* In dev, Vite seems buggy around setting vite.config.js#base to an absolute URL (e.g. http://localhost:8080/cdn/)
|
|
@@ -11,7 +11,7 @@ import { createRequire } from 'module';
|
|
|
11
11
|
import fs from 'fs/promises';
|
|
12
12
|
import path from 'path';
|
|
13
13
|
import { fixServerAssets, fixServerAssets_assertCssCodeSplit, fixServerAssets_assertCssTarget, fixServerAssets_assertCssTarget_populate, fixServerAssets_isEnabled } from './buildConfig/fixServerAssets.js';
|
|
14
|
-
import {
|
|
14
|
+
import { set_ASSETS_MANIFEST } from './buildEntry/index.js';
|
|
15
15
|
import { prependEntriesDir } from '../../shared/prependEntriesDir.js';
|
|
16
16
|
import { getFilePathResolved } from '../shared/getFilePath.js';
|
|
17
17
|
import { getConfigValueBuildTime } from '../../../shared/page-configs/getConfigValueBuildTime.js';
|
|
@@ -79,7 +79,7 @@ function buildConfig() {
|
|
|
79
79
|
name: 'vike:buildConfig:pre',
|
|
80
80
|
apply: 'build',
|
|
81
81
|
// Make sure other writeBundle() hooks are called after this writeBundle() hook.
|
|
82
|
-
// -
|
|
82
|
+
// - set_ASSETS_MANIFEST() needs to be called before dist/server/ code is executed.
|
|
83
83
|
// - For example, the writeBundle() hook of vite-plugin-vercel needs to be called after this writeBundle() hook, otherwise: https://github.com/vikejs/vike/issues/1527
|
|
84
84
|
enforce: 'pre',
|
|
85
85
|
writeBundle: {
|
|
@@ -102,7 +102,7 @@ function buildConfig() {
|
|
|
102
102
|
}
|
|
103
103
|
await fs.rm(clientManifestFilePath);
|
|
104
104
|
await fs.rm(serverManifestFilePath);
|
|
105
|
-
await
|
|
105
|
+
await set_ASSETS_MANIFEST(options, bundle);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -112,7 +112,10 @@ function buildConfig() {
|
|
|
112
112
|
async function getEntries(config) {
|
|
113
113
|
const vikeConfig = await getVikeConfig(config);
|
|
114
114
|
const { pageConfigs } = vikeConfig;
|
|
115
|
-
|
|
115
|
+
// TODO/v1-release: remove
|
|
116
|
+
const pageFileEntries = await getPageFileEntries(config,
|
|
117
|
+
// TODO/now: add meta.default
|
|
118
|
+
vikeConfig.global.config.includeAssetsImportedByServer ?? true);
|
|
116
119
|
assertUsage(Object.keys(pageFileEntries).length !== 0 || pageConfigs.length !== 0, 'At least one page should be defined, see https://vike.dev/add');
|
|
117
120
|
if (viteIsSSR(config)) {
|
|
118
121
|
const pageEntries = getPageEntries(pageConfigs);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { buildEntry };
|
|
2
|
-
export {
|
|
2
|
+
export { set_ASSETS_MANIFEST };
|
|
3
3
|
import type { Plugin, Rollup } from 'vite';
|
|
4
4
|
type Bundle = Rollup.OutputBundle;
|
|
5
5
|
type Options = Rollup.NormalizedOutputOptions;
|
|
6
6
|
declare function buildEntry(): Plugin[];
|
|
7
|
-
/** Set the value of the
|
|
8
|
-
declare function
|
|
7
|
+
/** Set the value of the ASSETS_MANIFEST constant inside dist/server/entry.js (or dist/server/index.js) */
|
|
8
|
+
declare function set_ASSETS_MANIFEST(options: Options, bundle: Bundle): Promise<void>;
|