vike 0.4.236-commit-e752d12 → 0.4.236-commit-79f1ef0
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/client/shared/createGetGlobalContextClient.js +20 -10
- package/dist/cjs/client/shared/utils.js +1 -0
- package/dist/cjs/node/runtime/globalContext.js +104 -20
- package/dist/cjs/node/runtime/html/injectAssets/getViteDevScript.js +3 -1
- package/dist/cjs/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.js +4 -0
- package/dist/cjs/node/runtime/renderPage/getPageAssets.js +3 -1
- package/dist/cjs/node/runtime/utils.js +4 -0
- package/dist/cjs/node/shared/utils.js +1 -0
- package/dist/cjs/node/shared/virtualFiles/virtualFileEntry.js +16 -14
- package/dist/cjs/node/shared/virtualFiles/virtualFilePageConfigLazy.js +10 -4
- package/dist/cjs/node/vite/index.js +2 -0
- package/dist/cjs/node/vite/plugins/pluginBuild/handleAssetsManifest.js +19 -11
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginAutoFullBuild.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildApp.js +28 -13
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginBuildConfig.js +0 -3
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginDistFileNames.js +12 -7
- package/dist/cjs/node/vite/plugins/pluginBuild/pluginModuleBanner.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginCommon.js +1 -0
- package/dist/cjs/node/vite/plugins/pluginDev/determineOptimizeDeps.js +102 -58
- package/dist/cjs/node/vite/plugins/pluginEnvVars.js +3 -3
- package/dist/cjs/node/vite/plugins/pluginExtractAssets.js +3 -4
- package/dist/cjs/node/vite/plugins/pluginExtractExportNames.js +2 -2
- package/dist/cjs/node/vite/plugins/pluginNonRunnableDev.js +51 -0
- package/dist/cjs/node/vite/plugins/pluginReplaceConstants.js +1 -1
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigLazy.js +1 -0
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigsEager.js +4 -0
- package/dist/cjs/node/vite/plugins/pluginVirtualFiles.js +4 -5
- package/dist/cjs/node/vite/shared/applyRegExWithMagicString.js +1 -0
- package/dist/cjs/node/vite/shared/getMagicString.js +18 -0
- package/dist/cjs/node/vite/shared/getManifestFilePathRelative.js +10 -0
- package/dist/cjs/node/vite/utils.js +1 -0
- package/dist/cjs/shared/createGlobalContextShared.js +5 -1
- package/dist/cjs/shared/getPageFiles/parseVirtualFileExports.js +6 -0
- package/dist/cjs/shared/getProxyForPublicUsage.js +2 -2
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/assertSetup.js +2 -0
- package/dist/cjs/utils/debug.js +1 -0
- package/dist/cjs/utils/getViteRPC.js +79 -0
- package/dist/cjs/utils/isFilePathAbsoluteFilesystem.js +1 -0
- package/dist/cjs/utils/isRunnableDevEnvironment.js +9 -0
- package/dist/cjs/utils/virtualFileId.js +39 -0
- package/dist/esm/client/runtime-client-routing/createPageContextClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/getPageContextFromHooks.d.ts +2 -2
- package/dist/esm/client/runtime-client-routing/globalContext.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/history.d.ts +4 -2
- package/dist/esm/client/runtime-client-routing/history.js +13 -35
- package/dist/esm/client/runtime-client-routing/initClientRouter.js +3 -2
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-client-routing/renderPageClientSide.js +43 -30
- package/dist/esm/client/runtime-server-routing/createPageContextClientSide.d.ts +1 -1
- package/dist/esm/client/runtime-server-routing/globalContext.d.ts +1 -1
- package/dist/esm/client/shared/createGetGlobalContextClient.d.ts +1 -1
- package/dist/esm/client/shared/createGetGlobalContextClient.js +20 -10
- package/dist/esm/client/shared/utils.d.ts +1 -0
- package/dist/esm/client/shared/utils.js +1 -0
- package/dist/esm/node/prerender/runPrerender.d.ts +40 -132
- package/dist/esm/node/runtime/globalContext.d.ts +32 -52
- package/dist/esm/node/runtime/globalContext.js +105 -21
- package/dist/esm/node/runtime/html/injectAssets/getViteDevScript.js +4 -2
- package/dist/esm/node/runtime/renderPage/createPageContextServerSide.d.ts +10 -33
- package/dist/esm/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.js +4 -0
- package/dist/esm/node/runtime/renderPage/getPageAssets.js +4 -2
- package/dist/esm/node/runtime/renderPage/renderPageAlreadyRouted.d.ts +20 -66
- package/dist/esm/node/runtime/renderPage.d.ts +10 -33
- package/dist/esm/node/runtime/utils.d.ts +4 -0
- package/dist/esm/node/runtime/utils.js +4 -0
- package/dist/esm/node/shared/utils.d.ts +1 -0
- package/dist/esm/node/shared/utils.js +1 -0
- package/dist/esm/node/shared/virtualFiles/virtualFileEntry.js +16 -14
- package/dist/esm/node/shared/virtualFiles/virtualFilePageConfigLazy.js +11 -5
- package/dist/esm/node/vite/index.js +2 -0
- package/dist/esm/node/vite/plugins/pluginBuild/handleAssetsManifest.d.ts +1 -1
- package/dist/esm/node/vite/plugins/pluginBuild/handleAssetsManifest.js +19 -11
- package/dist/esm/node/vite/plugins/pluginBuild/pluginAutoFullBuild.js +2 -2
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildApp.js +28 -13
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildConfig.d.ts +0 -2
- package/dist/esm/node/vite/plugins/pluginBuild/pluginBuildConfig.js +0 -2
- package/dist/esm/node/vite/plugins/pluginBuild/pluginDistFileNames.js +12 -7
- package/dist/esm/node/vite/plugins/pluginBuild/pluginModuleBanner.js +2 -2
- package/dist/esm/node/vite/plugins/pluginCommon.d.ts +3 -0
- package/dist/esm/node/vite/plugins/pluginCommon.js +1 -0
- package/dist/esm/node/vite/plugins/pluginDev/determineOptimizeDeps.js +103 -59
- package/dist/esm/node/vite/plugins/pluginExtractAssets.js +3 -4
- package/dist/esm/node/vite/plugins/pluginNonRunnableDev.d.ts +26 -0
- package/dist/esm/node/vite/plugins/pluginNonRunnableDev.js +49 -0
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigLazy.js +1 -0
- package/dist/esm/node/vite/plugins/pluginVirtualFiles/getVirtualFilePageConfigsEager.js +4 -0
- package/dist/esm/node/vite/plugins/pluginVirtualFiles.js +3 -4
- package/dist/esm/node/vite/shared/applyRegExWithMagicString.js +1 -0
- package/dist/esm/node/vite/shared/getMagicString.d.ts +9 -0
- package/dist/esm/node/vite/shared/getMagicString.js +13 -0
- package/dist/esm/node/vite/shared/getManifestFilePathRelative.d.ts +2 -0
- package/dist/esm/node/vite/shared/getManifestFilePathRelative.js +8 -0
- package/dist/esm/node/vite/utils.d.ts +1 -0
- package/dist/esm/node/vite/utils.js +1 -0
- package/dist/esm/shared/createGlobalContextShared.d.ts +3 -3
- package/dist/esm/shared/createGlobalContextShared.js +5 -1
- package/dist/esm/shared/getPageFiles/parseVirtualFileExports.js +6 -0
- 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 +2 -0
- package/dist/esm/utils/debug.d.ts +1 -1
- package/dist/esm/utils/debug.js +1 -0
- package/dist/esm/utils/getViteRPC.d.ts +6 -0
- package/dist/esm/utils/getViteRPC.js +77 -0
- package/dist/esm/utils/isFilePathAbsoluteFilesystem.d.ts +7 -0
- package/dist/esm/utils/isFilePathAbsoluteFilesystem.js +1 -0
- package/dist/esm/utils/isRunnableDevEnvironment.d.ts +3 -0
- package/dist/esm/utils/isRunnableDevEnvironment.js +7 -0
- package/dist/esm/utils/virtualFileId.d.ts +6 -0
- package/dist/esm/{node/shared/virtualFiles.js → utils/virtualFileId.js} +15 -17
- package/package.json +12 -3
- package/dist/cjs/node/shared/virtualFiles.js +0 -41
- package/dist/esm/node/shared/virtualFiles.d.ts +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { getViteDevScript };
|
|
2
|
-
import { assert, assertUsage, assertWarning } from '../../utils.js';
|
|
2
|
+
import { assert, assertUsage, assertWarning, getViteRPC } from '../../utils.js';
|
|
3
3
|
import pc from '@brillout/picocolors';
|
|
4
4
|
const reachOutCTA = 'Create a new GitHub issue to discuss a solution.';
|
|
5
5
|
async function getViteDevScript(pageContext) {
|
|
@@ -11,7 +11,9 @@ async function getViteDevScript(pageContext) {
|
|
|
11
11
|
const fakeHtmlBegin = '<html> <head>'; // White space to test whether user is using a minifier
|
|
12
12
|
const fakeHtmlEnd = '</head><body></body></html>';
|
|
13
13
|
let fakeHtml = fakeHtmlBegin + fakeHtmlEnd;
|
|
14
|
-
fakeHtml =
|
|
14
|
+
fakeHtml = viteDevServer
|
|
15
|
+
? await viteDevServer.transformIndexHtml('/', fakeHtml)
|
|
16
|
+
: await getViteRPC().transformIndexHtmlRPC(fakeHtml);
|
|
15
17
|
assertUsage(!fakeHtml.includes('vite-plugin-pwa'), `The HTML transformer of ${pc.cyan('vite-plugin-pwa')} cannot be applied, see workaround at https://github.com/vikejs/vike/issues/388#issuecomment-1199280084`);
|
|
16
18
|
assertUsage(!fakeHtml.startsWith(fakeHtmlBegin.replace(' ', '')), `Vite plugins that minify the HTML cannot be applied, see https://github.com/vikejs/vike/issues/224`);
|
|
17
19
|
assertUsage(fakeHtml.startsWith(fakeHtmlBegin) && fakeHtml.endsWith(fakeHtmlEnd), `You are using a Vite Plugin that transforms the HTML in a way that conflicts with Vike. ${reachOutCTA}`);
|
|
@@ -41,24 +41,12 @@ declare function createPageContextServerSide(pageContextInit: PageContextInit, g
|
|
|
41
41
|
pages: {
|
|
42
42
|
[k: string]: import("../../../shared/page-configs/resolveVikeConfigPublic.js").VikeConfigPublicPageEager;
|
|
43
43
|
};
|
|
44
|
-
} & ({
|
|
44
|
+
} & (({
|
|
45
45
|
_isProduction: false;
|
|
46
46
|
_isPrerendering: false;
|
|
47
47
|
assetsManifest: null;
|
|
48
|
-
_viteDevServer: import("vite").ViteDevServer;
|
|
49
|
-
viteConfig: import("vite").ResolvedConfig;
|
|
50
|
-
viteConfigRuntime: {
|
|
51
|
-
root: string;
|
|
52
|
-
build: {
|
|
53
|
-
outDir: string;
|
|
54
|
-
};
|
|
55
|
-
_baseViteOriginal: string;
|
|
56
|
-
vitePluginServerEntry: {
|
|
57
|
-
inject: boolean | undefined;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
baseServer: string;
|
|
61
|
-
baseAssets: string;
|
|
48
|
+
_viteDevServer: import("vite").ViteDevServer | undefined;
|
|
49
|
+
viteConfig: import("vite").ResolvedConfig | undefined;
|
|
62
50
|
isClientSide: false;
|
|
63
51
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
64
52
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
@@ -68,19 +56,7 @@ declare function createPageContextServerSide(pageContextInit: PageContextInit, g
|
|
|
68
56
|
_isProduction: true;
|
|
69
57
|
assetsManifest: import("../../../types/ViteManifest.js").ViteManifest;
|
|
70
58
|
_viteDevServer: null;
|
|
71
|
-
viteConfigRuntime: {
|
|
72
|
-
root: string;
|
|
73
|
-
build: {
|
|
74
|
-
outDir: string;
|
|
75
|
-
};
|
|
76
|
-
_baseViteOriginal: string;
|
|
77
|
-
vitePluginServerEntry: {
|
|
78
|
-
inject: boolean | undefined;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
59
|
_usesClientRouter: boolean;
|
|
82
|
-
baseServer: string;
|
|
83
|
-
baseAssets: string;
|
|
84
60
|
isClientSide: false;
|
|
85
61
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
86
62
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
@@ -90,6 +66,13 @@ declare function createPageContextServerSide(pageContextInit: PageContextInit, g
|
|
|
90
66
|
_isProduction: true;
|
|
91
67
|
assetsManifest: import("../../../types/ViteManifest.js").ViteManifest;
|
|
92
68
|
_viteDevServer: null;
|
|
69
|
+
_usesClientRouter: boolean;
|
|
70
|
+
isClientSide: false;
|
|
71
|
+
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
72
|
+
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
73
|
+
}) & {
|
|
74
|
+
baseServer: string;
|
|
75
|
+
baseAssets: string;
|
|
93
76
|
viteConfigRuntime: {
|
|
94
77
|
root: string;
|
|
95
78
|
build: {
|
|
@@ -100,12 +83,6 @@ declare function createPageContextServerSide(pageContextInit: PageContextInit, g
|
|
|
100
83
|
inject: boolean | undefined;
|
|
101
84
|
};
|
|
102
85
|
};
|
|
103
|
-
_usesClientRouter: boolean;
|
|
104
|
-
baseServer: string;
|
|
105
|
-
baseAssets: string;
|
|
106
|
-
isClientSide: false;
|
|
107
|
-
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
108
|
-
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
109
86
|
});
|
|
110
87
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
111
88
|
_baseServer: string;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export { retrieveAssetsDev };
|
|
2
2
|
import { assert, styleFileRE } from '../../utils.js';
|
|
3
|
+
import { isVirtualFileIdEntry } from '../../../shared/virtualFiles/virtualFileEntry.js';
|
|
3
4
|
async function retrieveAssetsDev(clientDependencies, viteDevServer) {
|
|
4
5
|
const assetUrls = new Set();
|
|
5
6
|
await Promise.all(clientDependencies.map(async ({ id }) => {
|
|
6
7
|
if (id.startsWith('@@vike'))
|
|
7
8
|
return; // vike doesn't have any CSS
|
|
8
9
|
assert(id);
|
|
10
|
+
assert(!isVirtualFileIdEntry(id));
|
|
9
11
|
const { moduleGraph } = viteDevServer;
|
|
10
12
|
const [_, graphId] = await moduleGraph.resolveUrl(id);
|
|
11
13
|
assert(graphId, { id });
|
|
@@ -32,6 +34,8 @@ function collectCss(mod, styleUrls, visitedModules, importer) {
|
|
|
32
34
|
if (visitedModules.has(mod.url))
|
|
33
35
|
return;
|
|
34
36
|
visitedModules.add(mod.url);
|
|
37
|
+
if (isVirtualFileIdEntry(mod.id || mod.url))
|
|
38
|
+
return; // virtual:vike:entry:server dependency list includes all pages
|
|
35
39
|
if (isStyle(mod) && (!importer || !isStyle(importer))) {
|
|
36
40
|
if (mod.url.startsWith('/')) {
|
|
37
41
|
styleUrls.add(mod.url);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { getPageAssets };
|
|
2
2
|
export { setResolveClientEntriesDev };
|
|
3
3
|
export { resolveIncludeAssetsImportedByServer };
|
|
4
|
-
import { assert, prependBase, toPosixPath, unique, getGlobalObject } from '../utils.js';
|
|
4
|
+
import { assert, prependBase, toPosixPath, unique, getGlobalObject, getViteRPC } from '../utils.js';
|
|
5
5
|
import { retrieveAssetsDev } from './getPageAssets/retrieveAssetsDev.js';
|
|
6
6
|
import { retrieveAssetsProd } from './getPageAssets/retrieveAssetsProd.js';
|
|
7
7
|
import { inferMediaType } from './inferMediaType.js';
|
|
@@ -15,7 +15,9 @@ async function getPageAssets(pageContext, clientDependencies, clientEntries) {
|
|
|
15
15
|
const { _isProduction: isProduction } = globalContext;
|
|
16
16
|
const isDev = !isProduction;
|
|
17
17
|
const { assetUrls, clientEntriesSrc } = isDev
|
|
18
|
-
?
|
|
18
|
+
? !globalContext._viteDevServer
|
|
19
|
+
? await getViteRPC().retrievePageAssetsDevRPC(clientDependencies, clientEntries)
|
|
20
|
+
: await retrievePageAssetsDev(globalContext._viteDevServer, clientDependencies, clientEntries)
|
|
19
21
|
: retrievePageAssetsProd(globalContext.assetsManifest, clientDependencies, clientEntries, resolveIncludeAssetsImportedByServer(globalContext.config));
|
|
20
22
|
let pageAssets = [];
|
|
21
23
|
unique([...clientEntriesSrc, ...assetUrls]).forEach((src) => {
|
|
@@ -56,24 +56,12 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
56
56
|
pages: {
|
|
57
57
|
[k: string]: import("../../../shared/page-configs/resolveVikeConfigPublic.js").VikeConfigPublicPageEager;
|
|
58
58
|
};
|
|
59
|
-
} & ({
|
|
59
|
+
} & (({
|
|
60
60
|
_isProduction: false;
|
|
61
61
|
_isPrerendering: false;
|
|
62
62
|
assetsManifest: null;
|
|
63
|
-
_viteDevServer: import("vite").ViteDevServer;
|
|
64
|
-
viteConfig: import("vite").ResolvedConfig;
|
|
65
|
-
viteConfigRuntime: {
|
|
66
|
-
root: string;
|
|
67
|
-
build: {
|
|
68
|
-
outDir: string;
|
|
69
|
-
};
|
|
70
|
-
_baseViteOriginal: string;
|
|
71
|
-
vitePluginServerEntry: {
|
|
72
|
-
inject: boolean | undefined;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
baseServer: string;
|
|
76
|
-
baseAssets: string;
|
|
63
|
+
_viteDevServer: import("vite").ViteDevServer | undefined;
|
|
64
|
+
viteConfig: import("vite").ResolvedConfig | undefined;
|
|
77
65
|
isClientSide: false;
|
|
78
66
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
79
67
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
@@ -83,19 +71,7 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
83
71
|
_isProduction: true;
|
|
84
72
|
assetsManifest: import("../../../types/ViteManifest.js").ViteManifest;
|
|
85
73
|
_viteDevServer: null;
|
|
86
|
-
viteConfigRuntime: {
|
|
87
|
-
root: string;
|
|
88
|
-
build: {
|
|
89
|
-
outDir: string;
|
|
90
|
-
};
|
|
91
|
-
_baseViteOriginal: string;
|
|
92
|
-
vitePluginServerEntry: {
|
|
93
|
-
inject: boolean | undefined;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
74
|
_usesClientRouter: boolean;
|
|
97
|
-
baseServer: string;
|
|
98
|
-
baseAssets: string;
|
|
99
75
|
isClientSide: false;
|
|
100
76
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
101
77
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
@@ -105,6 +81,13 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
105
81
|
_isProduction: true;
|
|
106
82
|
assetsManifest: import("../../../types/ViteManifest.js").ViteManifest;
|
|
107
83
|
_viteDevServer: null;
|
|
84
|
+
_usesClientRouter: boolean;
|
|
85
|
+
isClientSide: false;
|
|
86
|
+
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
87
|
+
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
88
|
+
}) & {
|
|
89
|
+
baseServer: string;
|
|
90
|
+
baseAssets: string;
|
|
108
91
|
viteConfigRuntime: {
|
|
109
92
|
root: string;
|
|
110
93
|
build: {
|
|
@@ -115,12 +98,6 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
115
98
|
inject: boolean | undefined;
|
|
116
99
|
};
|
|
117
100
|
};
|
|
118
|
-
_usesClientRouter: boolean;
|
|
119
|
-
baseServer: string;
|
|
120
|
-
baseAssets: string;
|
|
121
|
-
isClientSide: false;
|
|
122
|
-
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
123
|
-
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
124
101
|
});
|
|
125
102
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
126
103
|
_baseServer: string;
|
|
@@ -191,24 +168,12 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
191
168
|
pages: {
|
|
192
169
|
[k: string]: import("../../../shared/page-configs/resolveVikeConfigPublic.js").VikeConfigPublicPageEager;
|
|
193
170
|
};
|
|
194
|
-
} & ({
|
|
171
|
+
} & (({
|
|
195
172
|
_isProduction: false;
|
|
196
173
|
_isPrerendering: false;
|
|
197
174
|
assetsManifest: null;
|
|
198
|
-
_viteDevServer: import("vite").ViteDevServer;
|
|
199
|
-
viteConfig: import("vite").ResolvedConfig;
|
|
200
|
-
viteConfigRuntime: {
|
|
201
|
-
root: string;
|
|
202
|
-
build: {
|
|
203
|
-
outDir: string;
|
|
204
|
-
};
|
|
205
|
-
_baseViteOriginal: string;
|
|
206
|
-
vitePluginServerEntry: {
|
|
207
|
-
inject: boolean | undefined;
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
baseServer: string;
|
|
211
|
-
baseAssets: string;
|
|
175
|
+
_viteDevServer: import("vite").ViteDevServer | undefined;
|
|
176
|
+
viteConfig: import("vite").ResolvedConfig | undefined;
|
|
212
177
|
isClientSide: false;
|
|
213
178
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
214
179
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
@@ -218,19 +183,7 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
218
183
|
_isProduction: true;
|
|
219
184
|
assetsManifest: import("../../../types/ViteManifest.js").ViteManifest;
|
|
220
185
|
_viteDevServer: null;
|
|
221
|
-
viteConfigRuntime: {
|
|
222
|
-
root: string;
|
|
223
|
-
build: {
|
|
224
|
-
outDir: string;
|
|
225
|
-
};
|
|
226
|
-
_baseViteOriginal: string;
|
|
227
|
-
vitePluginServerEntry: {
|
|
228
|
-
inject: boolean | undefined;
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
186
|
_usesClientRouter: boolean;
|
|
232
|
-
baseServer: string;
|
|
233
|
-
baseAssets: string;
|
|
234
187
|
isClientSide: false;
|
|
235
188
|
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
236
189
|
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
@@ -240,6 +193,13 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
240
193
|
_isProduction: true;
|
|
241
194
|
assetsManifest: import("../../../types/ViteManifest.js").ViteManifest;
|
|
242
195
|
_viteDevServer: null;
|
|
196
|
+
_usesClientRouter: boolean;
|
|
197
|
+
isClientSide: false;
|
|
198
|
+
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
199
|
+
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
200
|
+
}) & {
|
|
201
|
+
baseServer: string;
|
|
202
|
+
baseAssets: string;
|
|
243
203
|
viteConfigRuntime: {
|
|
244
204
|
root: string;
|
|
245
205
|
build: {
|
|
@@ -250,12 +210,6 @@ declare function prerenderPage(pageContext: PageContextCreated & PageConfigsLazy
|
|
|
250
210
|
inject: boolean | undefined;
|
|
251
211
|
};
|
|
252
212
|
};
|
|
253
|
-
_usesClientRouter: boolean;
|
|
254
|
-
baseServer: string;
|
|
255
|
-
baseAssets: string;
|
|
256
|
-
isClientSide: false;
|
|
257
|
-
_pageRoutes: import("../../../__internal/index.js").PageRoutes;
|
|
258
|
-
_onBeforeRouteHook: import("../../../shared/hooks/getHook.js").Hook | null;
|
|
259
213
|
});
|
|
260
214
|
_pageFilesAll: import("../../../shared/getPageFiles.js").PageFile[];
|
|
261
215
|
_baseServer: string;
|
|
@@ -46,24 +46,12 @@ declare function getPageContextBegin(pageContextInit: PageContextInit, globalCon
|
|
|
46
46
|
pages: {
|
|
47
47
|
[k: string]: import("../../shared/page-configs/resolveVikeConfigPublic.js").VikeConfigPublicPageEager;
|
|
48
48
|
};
|
|
49
|
-
} & ({
|
|
49
|
+
} & (({
|
|
50
50
|
_isProduction: false;
|
|
51
51
|
_isPrerendering: false;
|
|
52
52
|
assetsManifest: null;
|
|
53
|
-
_viteDevServer: import("vite").ViteDevServer;
|
|
54
|
-
viteConfig: import("vite").ResolvedConfig;
|
|
55
|
-
viteConfigRuntime: {
|
|
56
|
-
root: string;
|
|
57
|
-
build: {
|
|
58
|
-
outDir: string;
|
|
59
|
-
};
|
|
60
|
-
_baseViteOriginal: string;
|
|
61
|
-
vitePluginServerEntry: {
|
|
62
|
-
inject: boolean | undefined;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
baseServer: string;
|
|
66
|
-
baseAssets: string;
|
|
53
|
+
_viteDevServer: import("vite").ViteDevServer | undefined;
|
|
54
|
+
viteConfig: import("vite").ResolvedConfig | undefined;
|
|
67
55
|
isClientSide: false;
|
|
68
56
|
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
69
57
|
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
@@ -73,19 +61,7 @@ declare function getPageContextBegin(pageContextInit: PageContextInit, globalCon
|
|
|
73
61
|
_isProduction: true;
|
|
74
62
|
assetsManifest: import("../../types/ViteManifest.js").ViteManifest;
|
|
75
63
|
_viteDevServer: null;
|
|
76
|
-
viteConfigRuntime: {
|
|
77
|
-
root: string;
|
|
78
|
-
build: {
|
|
79
|
-
outDir: string;
|
|
80
|
-
};
|
|
81
|
-
_baseViteOriginal: string;
|
|
82
|
-
vitePluginServerEntry: {
|
|
83
|
-
inject: boolean | undefined;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
64
|
_usesClientRouter: boolean;
|
|
87
|
-
baseServer: string;
|
|
88
|
-
baseAssets: string;
|
|
89
65
|
isClientSide: false;
|
|
90
66
|
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
91
67
|
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
@@ -95,6 +71,13 @@ declare function getPageContextBegin(pageContextInit: PageContextInit, globalCon
|
|
|
95
71
|
_isProduction: true;
|
|
96
72
|
assetsManifest: import("../../types/ViteManifest.js").ViteManifest;
|
|
97
73
|
_viteDevServer: null;
|
|
74
|
+
_usesClientRouter: boolean;
|
|
75
|
+
isClientSide: false;
|
|
76
|
+
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
77
|
+
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
78
|
+
}) & {
|
|
79
|
+
baseServer: string;
|
|
80
|
+
baseAssets: string;
|
|
98
81
|
viteConfigRuntime: {
|
|
99
82
|
root: string;
|
|
100
83
|
build: {
|
|
@@ -105,12 +88,6 @@ declare function getPageContextBegin(pageContextInit: PageContextInit, globalCon
|
|
|
105
88
|
inject: boolean | undefined;
|
|
106
89
|
};
|
|
107
90
|
};
|
|
108
|
-
_usesClientRouter: boolean;
|
|
109
|
-
baseServer: string;
|
|
110
|
-
baseAssets: string;
|
|
111
|
-
isClientSide: false;
|
|
112
|
-
_pageRoutes: import("../../shared/route/loadPageRoutes.js").PageRoutes;
|
|
113
|
-
_onBeforeRouteHook: import("../../shared/hooks/getHook.js").Hook | null;
|
|
114
91
|
});
|
|
115
92
|
_pageFilesAll: import("../../shared/getPageFiles.js").PageFile[];
|
|
116
93
|
_baseServer: string;
|
|
@@ -42,6 +42,7 @@ export * from '../../utils/assertSetup.js';
|
|
|
42
42
|
export * from '../../utils/path.js';
|
|
43
43
|
export * from '../../utils/isHtml.js';
|
|
44
44
|
export * from '../../utils/warnIfErrorIsNotObject.js';
|
|
45
|
+
export * from '../../utils/virtualFileId.js';
|
|
45
46
|
export * from '../../utils/stripAnsi.js';
|
|
46
47
|
export * from '../../utils/getTerminWidth.js';
|
|
47
48
|
export * from '../../utils/truncateString.js';
|
|
@@ -56,3 +57,6 @@ export * from '../../utils/PROJECT_VERSION.js';
|
|
|
56
57
|
export * from '../../utils/genPromise.js';
|
|
57
58
|
export * from '../../utils/augmentType.js';
|
|
58
59
|
export * from '../../utils/changeEnumerable.js';
|
|
60
|
+
export * from '../../utils/getViteRPC.js';
|
|
61
|
+
export * from '../../utils/isRunnableDevEnvironment.js';
|
|
62
|
+
export * from '../../utils/assertIsNotBrowser.js';
|
|
@@ -46,6 +46,7 @@ export * from '../../utils/assertSetup.js';
|
|
|
46
46
|
export * from '../../utils/path.js';
|
|
47
47
|
export * from '../../utils/isHtml.js';
|
|
48
48
|
export * from '../../utils/warnIfErrorIsNotObject.js';
|
|
49
|
+
export * from '../../utils/virtualFileId.js';
|
|
49
50
|
export * from '../../utils/stripAnsi.js';
|
|
50
51
|
export * from '../../utils/getTerminWidth.js';
|
|
51
52
|
export * from '../../utils/truncateString.js';
|
|
@@ -60,3 +61,6 @@ export * from '../../utils/PROJECT_VERSION.js';
|
|
|
60
61
|
export * from '../../utils/genPromise.js';
|
|
61
62
|
export * from '../../utils/augmentType.js';
|
|
62
63
|
export * from '../../utils/changeEnumerable.js';
|
|
64
|
+
export * from '../../utils/getViteRPC.js';
|
|
65
|
+
export * from '../../utils/isRunnableDevEnvironment.js';
|
|
66
|
+
export * from '../../utils/assertIsNotBrowser.js';
|
|
@@ -2,24 +2,26 @@ export { virtualFileIdEntryServer };
|
|
|
2
2
|
export { virtualFileIdEntryClientSR };
|
|
3
3
|
export { virtualFileIdEntryClientCR };
|
|
4
4
|
export { isVirtualFileIdEntry };
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
// TODO/now: merge virtualFileEntry.ts and virtualFilePageConfigLazy.ts
|
|
6
|
+
// - One function parseVirtualFileIdEntry() to rule them all?
|
|
7
|
+
import { assert, assertIsNotBrowser, removeVirtualFileIdPrefix } from '../utils.js';
|
|
8
|
+
assertIsNotBrowser();
|
|
9
|
+
// TODO/now: rename:
|
|
10
|
+
// ```diff
|
|
11
|
+
// - virtual:vike:entry:server
|
|
12
|
+
// + virtual:vike:entry:global:server
|
|
13
|
+
// ```
|
|
14
|
+
const virtualFileIdEntryServer = 'virtual:vike:entry:server';
|
|
15
|
+
const virtualFileIdEntryClientSR = 'virtual:vike:entry:client:server-routing';
|
|
16
|
+
const virtualFileIdEntryClientCR = 'virtual:vike:entry:client:client-routing';
|
|
17
|
+
const virtualFileIdEntries = [virtualFileIdEntryServer, virtualFileIdEntryClientCR, virtualFileIdEntryClientSR];
|
|
7
18
|
const idBase = 'virtual:vike:entry';
|
|
8
|
-
|
|
9
|
-
const virtualFileIdEntryClientSR = `${idBase}:client:server-routing`;
|
|
10
|
-
const virtualFileIdEntryClientCR = `${idBase}:client:client-routing`;
|
|
19
|
+
assert(virtualFileIdEntries.every((v) => v.startsWith(`${idBase}:`)));
|
|
11
20
|
function isVirtualFileIdEntry(id) {
|
|
12
|
-
id =
|
|
21
|
+
id = removeVirtualFileIdPrefix(id);
|
|
13
22
|
if (!id.startsWith(idBase))
|
|
14
23
|
return false;
|
|
15
|
-
assert(
|
|
16
|
-
// prettier-ignore
|
|
17
|
-
// biome-ignore format:
|
|
18
|
-
[
|
|
19
|
-
virtualFileIdEntryServer,
|
|
20
|
-
virtualFileIdEntryClientCR,
|
|
21
|
-
virtualFileIdEntryClientSR
|
|
22
|
-
].includes(id));
|
|
24
|
+
assert(virtualFileIdEntries.includes(id));
|
|
23
25
|
const isForClientSide = id !== virtualFileIdEntryServer;
|
|
24
26
|
const isClientRouting = id === virtualFileIdEntryClientCR;
|
|
25
27
|
return { isForClientSide, isClientRouting };
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
export { isVirtualFileIdPageConfigLazy };
|
|
2
2
|
export { getVirtualFileIdPageConfigLazy };
|
|
3
3
|
import { extractAssetsRemoveQuery } from '../extractAssetsQuery.js';
|
|
4
|
-
import { assert } from '../utils.js';
|
|
5
|
-
|
|
4
|
+
import { assert, assertIsNotBrowser, removeVirtualFileIdPrefix } from '../utils.js';
|
|
5
|
+
assertIsNotBrowser();
|
|
6
|
+
// TODO/now: rename:
|
|
7
|
+
// ```diff
|
|
8
|
+
// - virtual:vike:pageConfigLazy:server:
|
|
9
|
+
// + virtual:vike:entry:page:server:
|
|
10
|
+
// ```
|
|
11
|
+
const idBaseClient = 'virtual:vike:pageConfigLazy:client:';
|
|
12
|
+
const idBaseServer = 'virtual:vike:pageConfigLazy:server:';
|
|
6
13
|
const idBase = 'virtual:vike:pageConfigLazy:';
|
|
7
|
-
|
|
8
|
-
const idBaseServer = `${idBase}server:`;
|
|
14
|
+
// TODO/now: rename to generateVirtualFileIdEntry()
|
|
9
15
|
function getVirtualFileIdPageConfigLazy(pageId, isForClientSide) {
|
|
10
16
|
const id = `${isForClientSide ? idBaseClient : idBaseServer}${pageId}`;
|
|
11
17
|
return id;
|
|
12
18
|
}
|
|
13
19
|
function isVirtualFileIdPageConfigLazy(id) {
|
|
14
|
-
id =
|
|
20
|
+
id = removeVirtualFileIdPrefix(id);
|
|
15
21
|
if (!id.includes(idBase))
|
|
16
22
|
return false;
|
|
17
23
|
assert(id.startsWith(idBase));
|
|
@@ -22,6 +22,7 @@ import { resolveClientEntriesDev } from './shared/resolveClientEntriesDev.js';
|
|
|
22
22
|
import { pluginWorkaroundCssModuleHmr } from './plugins/pluginWorkaroundCssModuleHmr.js';
|
|
23
23
|
import { pluginWorkaroundVite6HmrRegression } from './plugins/pluginWorkaroundVite6HmrRegression.js';
|
|
24
24
|
import { pluginReplaceConstants } from './plugins/pluginReplaceConstants.js';
|
|
25
|
+
import { pluginNonRunnableDev } from './plugins/pluginNonRunnableDev.js';
|
|
25
26
|
// We don't call this in ./onLoad.ts to avoid a cyclic dependency with utils.ts
|
|
26
27
|
setResolveClientEntriesDev(resolveClientEntriesDev);
|
|
27
28
|
// Return `PluginInterop` instead of `Plugin` to avoid type mismatch upon different Vite versions
|
|
@@ -41,6 +42,7 @@ function plugin(vikeVitePluginOptions = {}) {
|
|
|
41
42
|
pluginWorkaroundCssModuleHmr(),
|
|
42
43
|
pluginWorkaroundVite6HmrRegression(),
|
|
43
44
|
pluginReplaceConstants(),
|
|
45
|
+
pluginNonRunnableDev(),
|
|
44
46
|
];
|
|
45
47
|
Object.assign(plugins, { _vikeVitePluginOptions: vikeVitePluginOptions });
|
|
46
48
|
return plugins;
|
|
@@ -11,7 +11,7 @@ declare function handleAssetsManifest_assertUsageCssTarget(config: ResolvedConfi
|
|
|
11
11
|
declare function handleAssetsManifest_getBuildConfig(config: UserConfig): Promise<{
|
|
12
12
|
readonly ssrEmitAssets: true | undefined;
|
|
13
13
|
readonly cssMinify: "esbuild" | undefined;
|
|
14
|
-
readonly manifest:
|
|
14
|
+
readonly manifest: true;
|
|
15
15
|
readonly copyPublicDir: boolean | undefined;
|
|
16
16
|
}>;
|
|
17
17
|
declare function handleAssetsManifest(config: ResolvedConfig, viteEnv: Environment | undefined, options: {
|
|
@@ -9,13 +9,13 @@ import path from 'node:path';
|
|
|
9
9
|
import { existsSync } from 'node:fs';
|
|
10
10
|
import { assert, assertIsSingleModuleInstance, assertWarning, isEqualStringList, isObject, pLimit, unique, } from '../../utils.js';
|
|
11
11
|
import { isVirtualFileIdPageConfigLazy } from '../../../shared/virtualFiles/virtualFilePageConfigLazy.js';
|
|
12
|
-
import { manifestTempFile } from './pluginBuildConfig.js';
|
|
13
12
|
import { getAssetsDir } from '../../shared/getAssetsDir.js';
|
|
14
13
|
import pc from '@brillout/picocolors';
|
|
15
14
|
import { getVikeConfigInternal, isV1Design } from '../../shared/resolveVikeConfigInternal.js';
|
|
16
15
|
import { getOutDirs } from '../../shared/getOutDirs.js';
|
|
17
16
|
import { isViteServerBuild_onlySsrEnv, isViteServerBuild } from '../../shared/isViteServerBuild.js';
|
|
18
17
|
import { set_macro_ASSETS_MANIFEST } from './pluginBuildEntry.js';
|
|
18
|
+
import { getManifestFilePathRelative } from '../../shared/getManifestFilePathRelative.js';
|
|
19
19
|
assertIsSingleModuleInstance('build/handleAssetsManifest.ts');
|
|
20
20
|
let assetsJsonFilePath;
|
|
21
21
|
// true => use workaround config.build.ssrEmitAssets
|
|
@@ -26,9 +26,8 @@ function handleAssetsManifest_isFixEnabled(config) {
|
|
|
26
26
|
}
|
|
27
27
|
/** https://github.com/vikejs/vike/issues/1339 */
|
|
28
28
|
async function fixServerAssets(config) {
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const serverManifest = await readManifestFile(outDirs.outDirServer);
|
|
29
|
+
const clientManifest = await readManifestFile(config, true);
|
|
30
|
+
const serverManifest = await readManifestFile(config, false);
|
|
32
31
|
const { clientManifestMod, serverManifestMod, filesToMove, filesToRemove } = addServerAssets(clientManifest, serverManifest);
|
|
33
32
|
await copyAssets(filesToMove, filesToRemove, config);
|
|
34
33
|
return { clientManifestMod, serverManifestMod };
|
|
@@ -265,8 +264,8 @@ function removeEmptyDirectories(dirPath) {
|
|
|
265
264
|
fs_sync.rmdirSync(dirPath);
|
|
266
265
|
}
|
|
267
266
|
}
|
|
268
|
-
async function readManifestFile(
|
|
269
|
-
const manifestFilePath =
|
|
267
|
+
async function readManifestFile(config, client) {
|
|
268
|
+
const manifestFilePath = getManifestFilePath(config, client);
|
|
270
269
|
const manifestFileContent = await fs.readFile(manifestFilePath, 'utf-8');
|
|
271
270
|
assert(manifestFileContent);
|
|
272
271
|
const manifest = JSON.parse(manifestFileContent);
|
|
@@ -287,7 +286,7 @@ async function handleAssetsManifest_getBuildConfig(config) {
|
|
|
287
286
|
ssrEmitAssets: isFixEnabled ? true : undefined,
|
|
288
287
|
// Required if `ssrEmitAssets: true`, see https://github.com/vitejs/vite/pull/11430#issuecomment-1454800934
|
|
289
288
|
cssMinify: isFixEnabled ? 'esbuild' : undefined,
|
|
290
|
-
manifest:
|
|
289
|
+
manifest: true,
|
|
291
290
|
copyPublicDir: vikeConfig.config.vite6BuilderApp
|
|
292
291
|
? // Already set by vike:build:pluginBuildApp
|
|
293
292
|
undefined
|
|
@@ -300,7 +299,7 @@ async function handleAssetsManifest(config, viteEnv, options, bundle) {
|
|
|
300
299
|
assert(!assetsJsonFilePath);
|
|
301
300
|
const outDirs = getOutDirs(config, viteEnv);
|
|
302
301
|
assetsJsonFilePath = path.posix.join(outDirs.outDirRoot, 'assets.json');
|
|
303
|
-
await writeAssetsManifestFile(
|
|
302
|
+
await writeAssetsManifestFile(assetsJsonFilePath, config);
|
|
304
303
|
}
|
|
305
304
|
if (isViteServerBuild(config, viteEnv)) {
|
|
306
305
|
const outDir = options.dir;
|
|
@@ -314,10 +313,10 @@ async function handleAssetsManifest(config, viteEnv, options, bundle) {
|
|
|
314
313
|
assert(!noop); // dist/server should always contain __VITE_ASSETS_MANIFEST__
|
|
315
314
|
}
|
|
316
315
|
}
|
|
317
|
-
async function writeAssetsManifestFile(
|
|
316
|
+
async function writeAssetsManifestFile(assetsJsonFilePath, config) {
|
|
318
317
|
const isFixEnabled = handleAssetsManifest_isFixEnabled(config);
|
|
319
|
-
const clientManifestFilePath =
|
|
320
|
-
const serverManifestFilePath =
|
|
318
|
+
const clientManifestFilePath = getManifestFilePath(config, true);
|
|
319
|
+
const serverManifestFilePath = getManifestFilePath(config, false);
|
|
321
320
|
if (!isFixEnabled) {
|
|
322
321
|
await fs.copyFile(clientManifestFilePath, assetsJsonFilePath);
|
|
323
322
|
}
|
|
@@ -328,3 +327,12 @@ async function writeAssetsManifestFile(outDirs, assetsJsonFilePath, config) {
|
|
|
328
327
|
await fs.rm(clientManifestFilePath);
|
|
329
328
|
await fs.rm(serverManifestFilePath);
|
|
330
329
|
}
|
|
330
|
+
function getManifestFilePath(config, client) {
|
|
331
|
+
const outDirs = getOutDirs(config);
|
|
332
|
+
const outDir = client ? outDirs.outDirClient : outDirs.outDirServer;
|
|
333
|
+
const env = client ? config.environments.client : config.environments.ssr;
|
|
334
|
+
assert(env);
|
|
335
|
+
const manifestFilePathRelative = getManifestFilePathRelative(env.build.manifest);
|
|
336
|
+
const manifestFilePath = path.posix.join(outDir, manifestFilePathRelative);
|
|
337
|
+
return manifestFilePath;
|
|
338
|
+
}
|
|
@@ -6,12 +6,12 @@ import { isPrerenderAutoRunEnabled, wasPrerenderRun } from '../../../prerender/c
|
|
|
6
6
|
import { isViteCliCall, getViteConfigFromCli } from '../../shared/isViteCliCall.js';
|
|
7
7
|
import pc from '@brillout/picocolors';
|
|
8
8
|
import { logErrorHint } from '../../../runtime/renderPage/logErrorHint.js';
|
|
9
|
-
import { manifestTempFile } from './pluginBuildConfig.js';
|
|
10
9
|
import { getVikeConfigInternal } from '../../shared/resolveVikeConfigInternal.js';
|
|
11
10
|
import { isVikeCliOrApi } from '../../../api/context.js';
|
|
12
11
|
import { handleAssetsManifest, handleAssetsManifest_assertUsageCssTarget } from './handleAssetsManifest.js';
|
|
13
12
|
import { isViteClientBuild, isViteServerBuild_onlySsrEnv } from '../../shared/isViteServerBuild.js';
|
|
14
13
|
import { runPrerender_forceExit, runPrerenderFromAutoRun } from '../../../prerender/runPrerenderEntry.js';
|
|
14
|
+
import { getManifestFilePathRelative } from '../../shared/getManifestFilePathRelative.js';
|
|
15
15
|
assertIsSingleModuleInstance('build/pluginAutoFullBuild.ts');
|
|
16
16
|
let forceExit = false;
|
|
17
17
|
function pluginAutoFullBuild() {
|
|
@@ -82,7 +82,7 @@ async function triggerFullBuild(config, viteEnv, bundle) {
|
|
|
82
82
|
// - The legacy plugin triggers its own Rollup build for the client-side.
|
|
83
83
|
// - The legacy plugin doesn't generate a manifest => we can use that to detect the legacy plugin build.
|
|
84
84
|
// - Issue & reproduction: https://github.com/vikejs/vike/issues/1154#issuecomment-1965954636
|
|
85
|
-
if (!bundle[
|
|
85
|
+
if (!bundle[getManifestFilePathRelative(config.build.manifest)])
|
|
86
86
|
return;
|
|
87
87
|
const configInline = getFullBuildInlineConfig(config);
|
|
88
88
|
if (!isBuilderApp) {
|