vike 0.4.223-commit-62ca594 → 0.4.223-commit-33cc798
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/plugin/plugins/build/{pluginAssetsManifest/fixServerAssets.js → handleAssetsManifest.js} +69 -28
- package/dist/cjs/node/plugin/plugins/build/pluginAutoFullBuild.js +38 -29
- package/dist/cjs/node/plugin/plugins/build/pluginBuildApp.js +4 -31
- package/dist/cjs/node/plugin/plugins/build/pluginBuildConfig.js +9 -5
- package/dist/cjs/node/plugin/plugins/build/pluginBuildEntry.js +1 -1
- package/dist/cjs/node/plugin/plugins/build/pluginDistFileNames.js +1 -1
- package/dist/cjs/node/plugin/plugins/build/pluginDistPackageJsonFile.js +2 -2
- package/dist/cjs/node/plugin/plugins/build.js +0 -2
- package/dist/cjs/node/plugin/plugins/commonConfig.js +1 -0
- package/dist/cjs/node/plugin/plugins/envVars.js +2 -2
- package/dist/cjs/node/plugin/plugins/extractAssetsPlugin.js +9 -9
- package/dist/cjs/node/plugin/plugins/extractExportNamesPlugin.js +2 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +3 -3
- package/dist/cjs/node/plugin/plugins/importUserCode/index.js +2 -5
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +3 -2
- package/dist/cjs/node/plugin/plugins/importUserCode/v1-design/virtual-files/getVirtualFilePageConfigValuesAll.js +4 -4
- package/dist/cjs/node/plugin/shared/getFullBuildInlineConfig.js +1 -0
- package/dist/cjs/node/plugin/shared/getOutDirs.js +8 -7
- package/dist/cjs/node/plugin/shared/isViteServerBuild.js +47 -0
- package/dist/cjs/node/prerender/runPrerender.js +1 -0
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/cjs/utils/requireResolve.js +7 -0
- package/dist/esm/node/plugin/plugins/build/handleAssetsManifest.d.ts +18 -0
- package/dist/esm/node/plugin/plugins/build/{pluginAssetsManifest/fixServerAssets.js → handleAssetsManifest.js} +69 -28
- package/dist/esm/node/plugin/plugins/build/pluginAutoFullBuild.d.ts +2 -0
- package/dist/esm/node/plugin/plugins/build/pluginAutoFullBuild.js +39 -30
- package/dist/esm/node/plugin/plugins/build/pluginBuildApp.js +5 -32
- package/dist/esm/node/plugin/plugins/build/pluginBuildConfig.js +9 -5
- package/dist/esm/node/plugin/plugins/build/pluginBuildEntry.d.ts +0 -1
- package/dist/esm/node/plugin/plugins/build/pluginBuildEntry.js +1 -1
- package/dist/esm/node/plugin/plugins/build/pluginDistFileNames.js +1 -1
- package/dist/esm/node/plugin/plugins/build/pluginDistPackageJsonFile.js +2 -2
- package/dist/esm/node/plugin/plugins/build.js +0 -2
- package/dist/esm/node/plugin/plugins/commonConfig.d.ts +1 -0
- package/dist/esm/node/plugin/plugins/commonConfig.js +1 -0
- package/dist/esm/node/plugin/plugins/envVars.js +2 -2
- package/dist/esm/node/plugin/plugins/extractAssetsPlugin.js +10 -10
- package/dist/esm/node/plugin/plugins/extractExportNamesPlugin.js +2 -2
- package/dist/esm/node/plugin/plugins/importUserCode/getVirtualFileImportUserCode.js +3 -3
- package/dist/esm/node/plugin/plugins/importUserCode/index.js +2 -5
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.d.ts +2 -2
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/getVikeConfig.js +3 -2
- package/dist/esm/node/plugin/plugins/importUserCode/v1-design/virtual-files/getVirtualFilePageConfigValuesAll.js +4 -4
- package/dist/esm/node/plugin/shared/getFullBuildInlineConfig.js +1 -0
- package/dist/esm/node/plugin/shared/getOutDirs.d.ts +2 -2
- package/dist/esm/node/plugin/shared/getOutDirs.js +8 -7
- package/dist/esm/node/plugin/shared/isViteServerBuild.d.ts +15 -0
- package/dist/esm/node/plugin/shared/isViteServerBuild.js +45 -0
- package/dist/esm/node/prerender/runPrerender.js +1 -0
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/utils/projectInfo.d.ts +1 -1
- package/dist/esm/utils/requireResolve.js +7 -0
- package/package.json +1 -1
- package/dist/cjs/node/plugin/plugins/build/pluginAssetsManifest.js +0 -115
- package/dist/cjs/node/plugin/shared/viteIsSSR.js +0 -31
- package/dist/esm/node/plugin/plugins/build/pluginAssetsManifest/fixServerAssets.d.ts +0 -22
- package/dist/esm/node/plugin/plugins/build/pluginAssetsManifest.d.ts +0 -3
- package/dist/esm/node/plugin/plugins/build/pluginAssetsManifest.js +0 -110
- package/dist/esm/node/plugin/shared/viteIsSSR.d.ts +0 -11
- package/dist/esm/node/plugin/shared/viteIsSSR.js +0 -29
|
@@ -3,33 +3,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
6
|
+
exports.handleAssetsManifest = handleAssetsManifest;
|
|
7
|
+
exports.handleAssetsManifest_getBuildConfig = handleAssetsManifest_getBuildConfig;
|
|
8
|
+
exports.handleAssetsManifest_isFixEnabled = handleAssetsManifest_isFixEnabled;
|
|
9
|
+
exports.handleAssetsManifest_assertUsageCssCodeSplit = handleAssetsManifest_assertUsageCssCodeSplit;
|
|
10
|
+
exports.handleAssetsManifest_assertUsageCssTarget = handleAssetsManifest_assertUsageCssTarget;
|
|
11
11
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
12
12
|
const fs_1 = __importDefault(require("fs"));
|
|
13
13
|
const path_1 = __importDefault(require("path"));
|
|
14
14
|
const fs_2 = require("fs");
|
|
15
|
-
const utils_js_1 = require("
|
|
16
|
-
const virtualFilePageConfigValuesAll_js_1 = require("
|
|
17
|
-
const pluginBuildConfig_js_1 = require("
|
|
18
|
-
const getAssetsDir_js_1 = require("
|
|
15
|
+
const utils_js_1 = require("../../utils.js");
|
|
16
|
+
const virtualFilePageConfigValuesAll_js_1 = require("../../../shared/virtual-files/virtualFilePageConfigValuesAll.js");
|
|
17
|
+
const pluginBuildConfig_js_1 = require("./pluginBuildConfig.js");
|
|
18
|
+
const getAssetsDir_js_1 = require("../../shared/getAssetsDir.js");
|
|
19
19
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
20
|
-
const getVikeConfig_js_1 = require("
|
|
21
|
-
const getOutDirs_js_1 = require("
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
function
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
return true;
|
|
20
|
+
const getVikeConfig_js_1 = require("../importUserCode/v1-design/getVikeConfig.js");
|
|
21
|
+
const getOutDirs_js_1 = require("../../shared/getOutDirs.js");
|
|
22
|
+
const isViteServerBuild_js_1 = require("../../shared/isViteServerBuild.js");
|
|
23
|
+
const commonConfig_js_1 = require("../commonConfig.js");
|
|
24
|
+
const pluginBuildEntry_js_1 = require("./pluginBuildEntry.js");
|
|
25
|
+
(0, utils_js_1.assertIsSingleModuleInstance)('build/handleAssetsManifest.ts');
|
|
26
|
+
let assetsJsonFilePath;
|
|
27
|
+
// true => use workaround config.build.ssrEmitAssets
|
|
28
|
+
// false => use workaround extractAssets plugin
|
|
29
|
+
function handleAssetsManifest_isFixEnabled(config) {
|
|
30
|
+
// Allow user to toggle between the two workarounds? E.g. based on https://vike.dev/includeAssetsImportedByServer.
|
|
31
|
+
return (0, getVikeConfig_js_1.isV1Design)(config);
|
|
33
32
|
}
|
|
34
33
|
/** https://github.com/vikejs/vike/issues/1339 */
|
|
35
34
|
async function fixServerAssets(config) {
|
|
@@ -218,16 +217,16 @@ function getHash(src) {
|
|
|
218
217
|
return hash;
|
|
219
218
|
}
|
|
220
219
|
// https://github.com/vikejs/vike/issues/1993
|
|
221
|
-
function
|
|
220
|
+
function handleAssetsManifest_assertUsageCssCodeSplit(config) {
|
|
221
|
+
if (!handleAssetsManifest_isFixEnabled(config))
|
|
222
|
+
return;
|
|
222
223
|
(0, utils_js_1.assertWarning)(config.build.cssCodeSplit, `${picocolors_1.default.cyan('build.cssCodeSplit')} shouldn't be set to ${picocolors_1.default.cyan('false')} (https://github.com/vikejs/vike/issues/1993)`, { onlyOnce: true });
|
|
223
224
|
}
|
|
224
225
|
const targets = [];
|
|
225
|
-
|
|
226
|
-
if (!
|
|
226
|
+
function handleAssetsManifest_assertUsageCssTarget(config) {
|
|
227
|
+
if (!handleAssetsManifest_isFixEnabled(config))
|
|
227
228
|
return;
|
|
228
|
-
|
|
229
|
-
return;
|
|
230
|
-
const isServerSide = (0, viteIsSSR_js_1.viteIsSSR)(config);
|
|
229
|
+
const isServerSide = (0, isViteServerBuild_js_1.isViteServerBuild)(config);
|
|
231
230
|
(0, utils_js_1.assert)(typeof isServerSide === 'boolean');
|
|
232
231
|
(0, utils_js_1.assert)(config.build.target !== undefined);
|
|
233
232
|
targets.push({ global: config.build.target, css: config.build.cssTarget, isServerSide });
|
|
@@ -286,3 +285,45 @@ async function writeManifestFile(manifest, manifestFilePath) {
|
|
|
286
285
|
const manifestFileContent = JSON.stringify(manifest, null, 2);
|
|
287
286
|
await promises_1.default.writeFile(manifestFilePath, manifestFileContent, 'utf-8');
|
|
288
287
|
}
|
|
288
|
+
function handleAssetsManifest_getBuildConfig(config) {
|
|
289
|
+
const vike = (0, commonConfig_js_1.getVikeConfigPublic)(config);
|
|
290
|
+
const isFixEnabled = handleAssetsManifest_isFixEnabled(config);
|
|
291
|
+
return {
|
|
292
|
+
// https://github.com/vikejs/vike/issues/1339
|
|
293
|
+
ssrEmitAssets: isFixEnabled ? true : undefined,
|
|
294
|
+
// Required if `ssrEmitAssets: true`, see https://github.com/vitejs/vite/pull/11430#issuecomment-1454800934
|
|
295
|
+
cssMinify: isFixEnabled ? 'esbuild' : undefined,
|
|
296
|
+
manifest: pluginBuildConfig_js_1.manifestTempFile,
|
|
297
|
+
copyPublicDir: vike.config.viteEnvironmentAPI
|
|
298
|
+
? // Already set by vike:build:pluginBuildApp
|
|
299
|
+
undefined
|
|
300
|
+
: !(0, isViteServerBuild_js_1.isViteServerBuild)(config)
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
async function handleAssetsManifest(config, viteEnv, options, bundle) {
|
|
304
|
+
if ((0, isViteServerBuild_js_1.isViteServerBuild_onlySsrEnv)(config, viteEnv)) {
|
|
305
|
+
(0, utils_js_1.assert)(!assetsJsonFilePath);
|
|
306
|
+
const outDirs = (0, getOutDirs_js_1.getOutDirs)(config, viteEnv);
|
|
307
|
+
assetsJsonFilePath = path_1.default.posix.join(outDirs.outDirRoot, 'assets.json');
|
|
308
|
+
await writeAssetsManifestFile(outDirs, assetsJsonFilePath, config);
|
|
309
|
+
}
|
|
310
|
+
if ((0, isViteServerBuild_js_1.isViteServerBuild)(config, viteEnv)) {
|
|
311
|
+
(0, utils_js_1.assert)(assetsJsonFilePath);
|
|
312
|
+
// Replace __VITE_ASSETS_MANIFEST__ in all server-side bundles
|
|
313
|
+
await (0, pluginBuildEntry_js_1.set_macro_ASSETS_MANIFEST)(options, bundle, assetsJsonFilePath);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
async function writeAssetsManifestFile(outDirs, assetsJsonFilePath, config) {
|
|
317
|
+
const isFixEnabled = handleAssetsManifest_isFixEnabled(config);
|
|
318
|
+
const clientManifestFilePath = path_1.default.posix.join(outDirs.outDirClient, pluginBuildConfig_js_1.manifestTempFile);
|
|
319
|
+
const serverManifestFilePath = path_1.default.posix.join(outDirs.outDirServer, pluginBuildConfig_js_1.manifestTempFile);
|
|
320
|
+
if (!isFixEnabled) {
|
|
321
|
+
await promises_1.default.copyFile(clientManifestFilePath, assetsJsonFilePath);
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
const { clientManifestMod } = await fixServerAssets(config);
|
|
325
|
+
await writeManifestFile(clientManifestMod, assetsJsonFilePath);
|
|
326
|
+
}
|
|
327
|
+
await promises_1.default.rm(clientManifestFilePath);
|
|
328
|
+
await promises_1.default.rm(serverManifestFilePath);
|
|
329
|
+
}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.pluginAutoFullBuild = pluginAutoFullBuild;
|
|
7
|
+
exports.isPrerenderForceExit = isPrerenderForceExit;
|
|
7
8
|
const getFullBuildInlineConfig_js_1 = require("../../shared/getFullBuildInlineConfig.js");
|
|
8
9
|
const vite_1 = require("vite");
|
|
9
10
|
const utils_js_1 = require("../../utils.js");
|
|
@@ -15,6 +16,9 @@ const logErrorHint_js_1 = require("../../../runtime/renderPage/logErrorHint.js")
|
|
|
15
16
|
const pluginBuildConfig_js_1 = require("./pluginBuildConfig.js");
|
|
16
17
|
const getVikeConfig_js_1 = require("../importUserCode/v1-design/getVikeConfig.js");
|
|
17
18
|
const context_js_2 = require("../../../api/context.js");
|
|
19
|
+
const handleAssetsManifest_js_1 = require("./handleAssetsManifest.js");
|
|
20
|
+
const isViteServerBuild_js_1 = require("../../shared/isViteServerBuild.js");
|
|
21
|
+
(0, utils_js_1.assertIsSingleModuleInstance)('build/pluginAutoFullBuild.ts');
|
|
18
22
|
let forceExit = false;
|
|
19
23
|
function pluginAutoFullBuild() {
|
|
20
24
|
let config;
|
|
@@ -30,19 +34,13 @@ function pluginAutoFullBuild() {
|
|
|
30
34
|
abortViteBuildSsr(vikeConfig);
|
|
31
35
|
},
|
|
32
36
|
writeBundle: {
|
|
33
|
-
/* We can't use this because it breaks Vite's logging. TODO: try again with latest Vite version.
|
|
37
|
+
/* We can't use this because it breaks Vite's logging. TODO/eventually: try again with latest Vite version.
|
|
34
38
|
sequential: true,
|
|
35
39
|
order: 'pre',
|
|
36
40
|
*/
|
|
37
|
-
async handler(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
// Avoid Rollup prefixing the error with [vike:build:pluginAutoFullBuild], for example see https://github.com/vikejs/vike/issues/472#issuecomment-1276274203
|
|
43
|
-
console.error(err);
|
|
44
|
-
process.exit(1);
|
|
45
|
-
}
|
|
41
|
+
async handler(options, bundle) {
|
|
42
|
+
await (0, handleAssetsManifest_js_1.handleAssetsManifest)(config, this.environment, options, bundle);
|
|
43
|
+
await triggerFullBuild(config, vikeConfig, this.environment, bundle);
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
},
|
|
@@ -54,7 +52,9 @@ function pluginAutoFullBuild() {
|
|
|
54
52
|
sequential: true,
|
|
55
53
|
order: 'post',
|
|
56
54
|
handler() {
|
|
57
|
-
if (forceExit
|
|
55
|
+
if (forceExit &&
|
|
56
|
+
// Let vike:build:pluginBuildApp force exit
|
|
57
|
+
!vikeConfig.global.config.viteEnvironmentAPI) {
|
|
58
58
|
(0, runPrerender_js_1.runPrerender_forceExit)();
|
|
59
59
|
(0, utils_js_1.assert)(false);
|
|
60
60
|
}
|
|
@@ -63,10 +63,14 @@ function pluginAutoFullBuild() {
|
|
|
63
63
|
}
|
|
64
64
|
];
|
|
65
65
|
}
|
|
66
|
-
async function triggerFullBuild(config, vikeConfig, bundle) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (
|
|
66
|
+
async function triggerFullBuild(config, vikeConfig, viteEnv, bundle) {
|
|
67
|
+
// Whether `builder.buildApp()` is being used, see plugin:build:pluginBuildApp
|
|
68
|
+
const isBuilderApp = vikeConfig.global.config.viteEnvironmentAPI;
|
|
69
|
+
// if builder.buildApp() => trigger at end of `this.environment.name === 'ssr'`.
|
|
70
|
+
// else => trigger at end of client-side build.
|
|
71
|
+
if (isBuilderApp ? !(0, isViteServerBuild_js_1.isViteServerBuild_onlySsrEnv)(config, viteEnv) : !(0, isViteServerBuild_js_1.isViteClientBuild)(config, viteEnv))
|
|
72
|
+
return;
|
|
73
|
+
if (isEntirelyDisabled(vikeConfig))
|
|
70
74
|
return;
|
|
71
75
|
// Workaround for @vitejs/plugin-legacy
|
|
72
76
|
// - The legacy plugin triggers its own Rollup build for the client-side.
|
|
@@ -75,13 +79,18 @@ async function triggerFullBuild(config, vikeConfig, bundle) {
|
|
|
75
79
|
if (!bundle[pluginBuildConfig_js_1.manifestTempFile])
|
|
76
80
|
return;
|
|
77
81
|
const configInline = (0, getFullBuildInlineConfig_js_1.getFullBuildInlineConfig)(config);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
if (
|
|
83
|
+
// Already chained by builder.buildApp()
|
|
84
|
+
!isBuilderApp) {
|
|
85
|
+
try {
|
|
86
|
+
await (0, vite_1.build)(setSSR(configInline));
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
// Avoid Rollup prefixing the error with [vike:build:pluginAutoFullBuild], see for example https://github.com/vikejs/vike/issues/472#issuecomment-1276274203
|
|
90
|
+
console.error(err);
|
|
91
|
+
(0, logErrorHint_js_1.logErrorHint)(err);
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
85
94
|
}
|
|
86
95
|
if ((0, context_js_1.isPrerenderAutoRunEnabled)(vikeConfig)) {
|
|
87
96
|
const res = await (0, runPrerender_js_1.runPrerenderFromAutoRun)(configInline, config);
|
|
@@ -103,16 +112,16 @@ function abortViteBuildSsr(vikeConfig) {
|
|
|
103
112
|
process.exit(0);
|
|
104
113
|
}
|
|
105
114
|
}
|
|
106
|
-
function
|
|
107
|
-
const { disableAutoFullBuild
|
|
108
|
-
if (viteEnvironmentAPI) {
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
115
|
+
function isEntirelyDisabled(vikeConfig) {
|
|
116
|
+
const { disableAutoFullBuild } = vikeConfig.global.config;
|
|
111
117
|
if (disableAutoFullBuild === undefined || disableAutoFullBuild === 'prerender') {
|
|
112
|
-
const
|
|
113
|
-
return
|
|
118
|
+
const isUserUsingViteApi = !(0, isViteCliCall_js_1.isViteCliCall)() && !(0, context_js_2.isVikeCliOrApi)();
|
|
119
|
+
return isUserUsingViteApi;
|
|
114
120
|
}
|
|
115
121
|
else {
|
|
116
122
|
return disableAutoFullBuild;
|
|
117
123
|
}
|
|
118
124
|
}
|
|
125
|
+
function isPrerenderForceExit() {
|
|
126
|
+
return forceExit;
|
|
127
|
+
}
|
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pluginBuildApp = pluginBuildApp;
|
|
4
4
|
const runPrerender_js_1 = require("../../../prerender/runPrerender.js");
|
|
5
|
-
const context_js_1 = require("../../../prerender/context.js");
|
|
6
5
|
const getOutDirs_js_1 = require("../../shared/getOutDirs.js");
|
|
7
6
|
const utils_js_1 = require("../../utils.js");
|
|
8
|
-
const getVikeConfig_js_1 = require("../importUserCode/v1-design/getVikeConfig.js");
|
|
9
|
-
const getFullBuildInlineConfig_js_1 = require("../../shared/getFullBuildInlineConfig.js");
|
|
10
7
|
const commonConfig_js_1 = require("../commonConfig.js");
|
|
8
|
+
const pluginAutoFullBuild_js_1 = require("./pluginAutoFullBuild.js");
|
|
11
9
|
function pluginBuildApp() {
|
|
12
|
-
let config;
|
|
13
|
-
// `builder.buildApp()` can be overriden by another plugin e.g vike-vercel https://github.com/vikejs/vike/pull/2184#issuecomment-2659425195
|
|
14
|
-
// In that case, we should'nt `forceExit`.
|
|
15
|
-
let forceExit = false;
|
|
16
10
|
return [
|
|
17
11
|
{
|
|
18
12
|
name: 'vike:build:pluginBuildApp',
|
|
@@ -23,12 +17,13 @@ function pluginBuildApp() {
|
|
|
23
17
|
return;
|
|
24
18
|
return {
|
|
25
19
|
builder: {
|
|
26
|
-
|
|
20
|
+
// Can be overriden by another plugin e.g vike-vercel https://github.com/vikejs/vike/pull/2184#issuecomment-2659425195
|
|
21
|
+
async buildApp(builder) {
|
|
27
22
|
(0, utils_js_1.assert)(builder.environments.client);
|
|
28
23
|
(0, utils_js_1.assert)(builder.environments.ssr);
|
|
29
24
|
await builder.build(builder.environments.client);
|
|
30
25
|
await builder.build(builder.environments.ssr);
|
|
31
|
-
if (
|
|
26
|
+
if ((0, pluginAutoFullBuild_js_1.isPrerenderForceExit)()) {
|
|
32
27
|
(0, runPrerender_js_1.runPrerender_forceExit)();
|
|
33
28
|
(0, utils_js_1.assert)(false);
|
|
34
29
|
}
|
|
@@ -52,28 +47,6 @@ function pluginBuildApp() {
|
|
|
52
47
|
}
|
|
53
48
|
};
|
|
54
49
|
}
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
name: 'vike:build:pluginBuildApp:prerender',
|
|
58
|
-
apply: 'build',
|
|
59
|
-
enforce: 'pre',
|
|
60
|
-
applyToEnvironment(env) {
|
|
61
|
-
return env.name === 'ssr';
|
|
62
|
-
},
|
|
63
|
-
configResolved(_config) {
|
|
64
|
-
config = _config;
|
|
65
|
-
},
|
|
66
|
-
async writeBundle() {
|
|
67
|
-
const vike = (0, commonConfig_js_1.getVikeConfigPublic)(config);
|
|
68
|
-
if (!vike.config.viteEnvironmentAPI)
|
|
69
|
-
return;
|
|
70
|
-
const vikeConfig = await (0, getVikeConfig_js_1.getVikeConfig)(config);
|
|
71
|
-
if (!(0, context_js_1.isPrerenderAutoRunEnabled)(vikeConfig))
|
|
72
|
-
return;
|
|
73
|
-
const configInline = (0, getFullBuildInlineConfig_js_1.getFullBuildInlineConfig)(config);
|
|
74
|
-
const res = await (0, runPrerender_js_1.runPrerenderFromAutoRun)(configInline, config);
|
|
75
|
-
forceExit = res.forceExit;
|
|
76
|
-
}
|
|
77
50
|
}
|
|
78
51
|
];
|
|
79
52
|
}
|
|
@@ -13,8 +13,9 @@ const module_1 = require("module");
|
|
|
13
13
|
const prependEntriesDir_js_1 = require("../../../shared/prependEntriesDir.js");
|
|
14
14
|
const getFilePath_js_1 = require("../../shared/getFilePath.js");
|
|
15
15
|
const getConfigValueBuildTime_js_1 = require("../../../../shared/page-configs/getConfigValueBuildTime.js");
|
|
16
|
-
const
|
|
16
|
+
const isViteServerBuild_js_1 = require("../../shared/isViteServerBuild.js");
|
|
17
17
|
const getOutDirs_js_1 = require("../../shared/getOutDirs.js");
|
|
18
|
+
const handleAssetsManifest_js_1 = require("./handleAssetsManifest.js");
|
|
18
19
|
// @ts-ignore `file://${__filename}` is shimmed at dist/cjs by dist-cjs-fixup.js.
|
|
19
20
|
const importMetaUrl = `file://${__filename}`;
|
|
20
21
|
const require_ = (0, module_1.createRequire)(importMetaUrl);
|
|
@@ -37,6 +38,7 @@ function pluginBuildConfig() {
|
|
|
37
38
|
(0, utils_js_1.assert)(Object.keys(entries).length > 0);
|
|
38
39
|
config.build.rollupOptions.input = (0, utils_js_1.injectRollupInputs)(entries, config);
|
|
39
40
|
addLogHook();
|
|
41
|
+
(0, handleAssetsManifest_js_1.handleAssetsManifest_assertUsageCssCodeSplit)(config);
|
|
40
42
|
}
|
|
41
43
|
},
|
|
42
44
|
config: {
|
|
@@ -45,7 +47,8 @@ function pluginBuildConfig() {
|
|
|
45
47
|
(0, utils_js_1.onSetupBuild)();
|
|
46
48
|
return {
|
|
47
49
|
build: {
|
|
48
|
-
outDir: (0, getOutDirs_js_1.resolveOutDir)(config)
|
|
50
|
+
outDir: (0, getOutDirs_js_1.resolveOutDir)(config),
|
|
51
|
+
...(0, handleAssetsManifest_js_1.handleAssetsManifest_getBuildConfig)(config)
|
|
49
52
|
}
|
|
50
53
|
};
|
|
51
54
|
}
|
|
@@ -53,8 +56,9 @@ function pluginBuildConfig() {
|
|
|
53
56
|
buildStart() {
|
|
54
57
|
(0, utils_js_1.onSetupBuild)();
|
|
55
58
|
},
|
|
56
|
-
|
|
59
|
+
closeBundle() {
|
|
57
60
|
(0, utils_js_1.onSetupBuild)();
|
|
61
|
+
(0, handleAssetsManifest_js_1.handleAssetsManifest_assertUsageCssTarget)(config);
|
|
58
62
|
}
|
|
59
63
|
}
|
|
60
64
|
];
|
|
@@ -67,7 +71,7 @@ async function getEntries(config) {
|
|
|
67
71
|
// TODO/now: add meta.default
|
|
68
72
|
vikeConfig.global.config.includeAssetsImportedByServer ?? true);
|
|
69
73
|
(0, utils_js_1.assertUsage)(Object.keys(pageFileEntries).length !== 0 || pageConfigs.length !== 0, 'At least one page should be defined, see https://vike.dev/add');
|
|
70
|
-
if ((0,
|
|
74
|
+
if ((0, isViteServerBuild_js_1.isViteServerBuild)(config)) {
|
|
71
75
|
const pageEntries = getPageEntries(pageConfigs);
|
|
72
76
|
const entries = {
|
|
73
77
|
...pageFileEntries,
|
|
@@ -140,7 +144,7 @@ function analyzeClientEntries(pageConfigs, config) {
|
|
|
140
144
|
// Ensure Rollup creates entries for each page file, see https://github.com/vikejs/vike/issues/350
|
|
141
145
|
// (Otherwise the page files may be missing in the client manifest.json)
|
|
142
146
|
async function getPageFileEntries(config, includeAssetsImportedByServer) {
|
|
143
|
-
const isForClientSide = !(0,
|
|
147
|
+
const isForClientSide = !(0, isViteServerBuild_js_1.isViteServerBuild)(config);
|
|
144
148
|
const fileTypes = isForClientSide ? ['.page', '.page.client'] : ['.page', '.page.server'];
|
|
145
149
|
if (isForClientSide && includeAssetsImportedByServer) {
|
|
146
150
|
fileTypes.push('.page.server');
|
|
@@ -64,7 +64,7 @@ function getServerProductionEntryCode(config) {
|
|
|
64
64
|
].join('\n');
|
|
65
65
|
return importerCode;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
// Set the value of the ASSETS_MANIFEST constant inside dist/server/entry.js (or dist/server/index.js)
|
|
68
68
|
async function set_macro_ASSETS_MANIFEST(options, bundle, assetsJsonFilePath) {
|
|
69
69
|
const { dir } = options;
|
|
70
70
|
(0, utils_js_1.assert)(dir);
|
|
@@ -33,7 +33,7 @@ function pluginDistFileNames() {
|
|
|
33
33
|
else {
|
|
34
34
|
// If a user needs this:
|
|
35
35
|
// - assertUsage() that the naming provided by the user ends with `.[hash][extname]`
|
|
36
|
-
// - It's needed for getHash() of
|
|
36
|
+
// - It's needed for getHash() of handleAssetsManifest()
|
|
37
37
|
// - Asset URLs should always contain a hash: it's paramount for caching assets.
|
|
38
38
|
// - If rollupOutput.assetFileNames is a function then use a wrapper function to apply the assertUsage()
|
|
39
39
|
(0, utils_js_1.assertUsage)(false, "Setting Vite's configuration build.rollupOptions.output.assetFileNames is currently forbidden. Reach out if you need to use.");
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.pluginDistPackageJsonFile = pluginDistPackageJsonFile;
|
|
12
12
|
const rollupIsEsm_js_1 = require("../../shared/rollupIsEsm.js");
|
|
13
|
-
const
|
|
13
|
+
const isViteServerBuild_js_1 = require("../../shared/isViteServerBuild.js");
|
|
14
14
|
function pluginDistPackageJsonFile() {
|
|
15
15
|
let config;
|
|
16
16
|
return {
|
|
@@ -20,7 +20,7 @@ function pluginDistPackageJsonFile() {
|
|
|
20
20
|
config = config_;
|
|
21
21
|
},
|
|
22
22
|
generateBundle(options, bundle) {
|
|
23
|
-
if (!(0,
|
|
23
|
+
if (!(0, isViteServerBuild_js_1.isViteServerBuild)(config))
|
|
24
24
|
return;
|
|
25
25
|
const isEsm = (0, rollupIsEsm_js_1.rollupIsEsm)(options);
|
|
26
26
|
const fileName = 'package.json';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.build = build;
|
|
4
|
-
const pluginAssetsManifest_js_1 = require("./build/pluginAssetsManifest.js");
|
|
5
4
|
const pluginBuildApp_js_1 = require("./build/pluginBuildApp.js");
|
|
6
5
|
const pluginDistPackageJsonFile_js_1 = require("./build/pluginDistPackageJsonFile.js");
|
|
7
6
|
const pluginSuppressRollupWarning_js_1 = require("./build/pluginSuppressRollupWarning.js");
|
|
@@ -11,7 +10,6 @@ const pluginBuildEntry_js_1 = require("./build/pluginBuildEntry.js");
|
|
|
11
10
|
const pluginBuildConfig_js_1 = require("./build/pluginBuildConfig.js");
|
|
12
11
|
function build() {
|
|
13
12
|
return [
|
|
14
|
-
...(0, pluginAssetsManifest_js_1.pluginAssetsManifest)(),
|
|
15
13
|
...(0, pluginBuildConfig_js_1.pluginBuildConfig)(),
|
|
16
14
|
...(0, pluginBuildApp_js_1.pluginBuildApp)(),
|
|
17
15
|
...(0, pluginAutoFullBuild_js_1.pluginAutoFullBuild)(),
|
|
@@ -6,7 +6,7 @@ const utils_js_1 = require("../utils.js");
|
|
|
6
6
|
const rollupSourceMap_js_1 = require("../shared/rollupSourceMap.js");
|
|
7
7
|
const getFilePath_js_1 = require("../shared/getFilePath.js");
|
|
8
8
|
const normalizeId_js_1 = require("../shared/normalizeId.js");
|
|
9
|
-
const
|
|
9
|
+
const isViteServerBuild_js_1 = require("../shared/isViteServerBuild.js");
|
|
10
10
|
// TODO/enventually: (after we implemented vike.config.js)
|
|
11
11
|
// - Make import.meta.env work inside +config.js
|
|
12
12
|
// - For it to work, we'll probably need the user to define the settings (e.g. `envDir`) for loadEnv() inside vike.config.js instead of vite.config.js
|
|
@@ -39,7 +39,7 @@ function envVarsPlugin() {
|
|
|
39
39
|
if (!code.includes('import.meta.env.'))
|
|
40
40
|
return;
|
|
41
41
|
const isBuild = config.command === 'build';
|
|
42
|
-
const isClientSide = !(0,
|
|
42
|
+
const isClientSide = !(0, isViteServerBuild_js_1.isViteServerBuild_safe)(config, options);
|
|
43
43
|
Object.entries(envsAll)
|
|
44
44
|
.filter(([key]) => {
|
|
45
45
|
// Already handled by Vite
|
|
@@ -14,11 +14,11 @@ const isAsset_js_1 = require("../shared/isAsset.js");
|
|
|
14
14
|
const parseEsModule_js_1 = require("../shared/parseEsModule.js");
|
|
15
15
|
const rollupSourceMap_js_1 = require("../shared/rollupSourceMap.js");
|
|
16
16
|
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
17
|
-
const
|
|
17
|
+
const handleAssetsManifest_js_1 = require("./build/handleAssetsManifest.js");
|
|
18
18
|
const getVikeConfig_js_1 = require("./importUserCode/v1-design/getVikeConfig.js");
|
|
19
19
|
const assertV1Design_js_1 = require("../../shared/assertV1Design.js");
|
|
20
20
|
const normalizeId_js_1 = require("../shared/normalizeId.js");
|
|
21
|
-
const
|
|
21
|
+
const isViteServerBuild_js_1 = require("../shared/isViteServerBuild.js");
|
|
22
22
|
const extractAssetsRE = /(\?|&)extractAssets(?:&|$)/;
|
|
23
23
|
exports.extractAssetsRE = extractAssetsRE;
|
|
24
24
|
const rawRE = /(\?|&)raw(?:&|$)/;
|
|
@@ -28,7 +28,7 @@ const debug = (0, utils_js_1.createDebugger)('vike:extractAssets');
|
|
|
28
28
|
function extractAssetsPlugin() {
|
|
29
29
|
let config;
|
|
30
30
|
let vikeConfig;
|
|
31
|
-
let
|
|
31
|
+
let isFixEnabled;
|
|
32
32
|
return [
|
|
33
33
|
// This plugin removes all JavaScript from server-side only code, so that only CSS imports remains. (And also satic files imports e.g. `import logoURL from './logo.svg.js'`).
|
|
34
34
|
{
|
|
@@ -41,14 +41,14 @@ function extractAssetsPlugin() {
|
|
|
41
41
|
if (!extractAssetsRE.test(id)) {
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
if (
|
|
45
|
-
// I'm guessing
|
|
44
|
+
if (isFixEnabled) {
|
|
45
|
+
// I'm guessing isFixEnabled can only be true when mixing both designs: https://github.com/vikejs/vike/issues/1480
|
|
46
46
|
(0, assertV1Design_js_1.assertV1Design)(vikeConfig.pageConfigs, true);
|
|
47
47
|
(0, utils_js_1.assert)(false);
|
|
48
48
|
}
|
|
49
49
|
// TODO/now: add meta.default
|
|
50
50
|
(0, utils_js_1.assert)(vikeConfig.global.config.includeAssetsImportedByServer ?? true);
|
|
51
|
-
(0, utils_js_1.assert)(!(0,
|
|
51
|
+
(0, utils_js_1.assert)(!(0, isViteServerBuild_js_1.isViteServerBuild_safe)(config, options));
|
|
52
52
|
const importStatements = await (0, parseEsModule_js_1.getImportStatements)(src);
|
|
53
53
|
const moduleNames = getImportedModules(importStatements);
|
|
54
54
|
const code = moduleNames.map((moduleName) => `import '${moduleName}';`).join('\n');
|
|
@@ -65,7 +65,7 @@ function extractAssetsPlugin() {
|
|
|
65
65
|
// - Vite's `vite:resolve` plugin; https://github.com/vitejs/vite/blob/d649daba7682791178b711d9a3e44a6b5d00990c/packages/vite/src/node/plugins/resolve.ts#L105
|
|
66
66
|
enforce: 'pre',
|
|
67
67
|
async resolveId(source, importer, options) {
|
|
68
|
-
if ((0,
|
|
68
|
+
if ((0, isViteServerBuild_js_1.isViteServerBuild_safe)(config, options)) {
|
|
69
69
|
// When building for the server, there should never be a `?extractAssets` query
|
|
70
70
|
(0, utils_js_1.assert)(!extractAssetsRE.test(source));
|
|
71
71
|
(0, utils_js_1.assert)(importer === undefined || !extractAssetsRE.test(importer));
|
|
@@ -142,8 +142,8 @@ function extractAssetsPlugin() {
|
|
|
142
142
|
async configResolved(config_) {
|
|
143
143
|
config = config_;
|
|
144
144
|
vikeConfig = await (0, getVikeConfig_js_1.getVikeConfig)(config);
|
|
145
|
-
|
|
146
|
-
if (!
|
|
145
|
+
isFixEnabled = (0, handleAssetsManifest_js_1.handleAssetsManifest_isFixEnabled)(config);
|
|
146
|
+
if (!isFixEnabled) {
|
|
147
147
|
// https://github.com/vikejs/vike/issues/1060
|
|
148
148
|
(0, utils_js_1.assertUsage)(!config.plugins.find((p) => p.name === 'vite-tsconfig-paths'), 'vite-tsconfig-paths not supported, remove it and use vite.config.js#resolve.alias instead');
|
|
149
149
|
}
|
|
@@ -7,7 +7,7 @@ const utils_js_1 = require("../utils.js");
|
|
|
7
7
|
const parseEsModule_js_1 = require("../shared/parseEsModule.js");
|
|
8
8
|
const rollupSourceMap_js_1 = require("../shared/rollupSourceMap.js");
|
|
9
9
|
const normalizeId_js_1 = require("../shared/normalizeId.js");
|
|
10
|
-
const
|
|
10
|
+
const isViteServerBuild_js_1 = require("../shared/isViteServerBuild.js");
|
|
11
11
|
const extractExportNamesRE = /(\?|&)extractExportNames(?:&|$)/;
|
|
12
12
|
exports.extractExportNamesRE = extractExportNamesRE;
|
|
13
13
|
const debug = (0, utils_js_1.createDebugger)('vike:extractExportNames');
|
|
@@ -19,7 +19,7 @@ function extractExportNamesPlugin() {
|
|
|
19
19
|
enforce: 'post',
|
|
20
20
|
async transform(src, id, options) {
|
|
21
21
|
id = (0, normalizeId_js_1.normalizeId)(id);
|
|
22
|
-
const isClientSide = !(0,
|
|
22
|
+
const isClientSide = !(0, isViteServerBuild_js_1.isViteServerBuild_options)(options);
|
|
23
23
|
if (extractExportNamesRE.test(id)) {
|
|
24
24
|
const code = await getExtractExportNamesCode(src, isClientSide, !isDev, id);
|
|
25
25
|
debug('id ' + id, ['result:\n' + code.code.trim(), 'src:\n' + src.trim()]);
|
|
@@ -12,12 +12,12 @@ const path_1 = __importDefault(require("path"));
|
|
|
12
12
|
const getVirtualFilePageConfigs_js_1 = require("./v1-design/virtual-files/getVirtualFilePageConfigs.js");
|
|
13
13
|
const getVikeConfig_js_1 = require("./v1-design/getVikeConfig.js");
|
|
14
14
|
const getOutDirs_js_1 = require("../../shared/getOutDirs.js");
|
|
15
|
-
const
|
|
15
|
+
const isViteServerBuild_js_1 = require("../../shared/isViteServerBuild.js");
|
|
16
16
|
async function getVirtualFileImportUserCode(id, options, vikeConfig, config, isDev) {
|
|
17
17
|
const idParsed = (0, virtualFileImportUserCode_js_1.isVirtualFileIdImportUserCode)(id);
|
|
18
18
|
(0, utils_js_1.assert)(idParsed);
|
|
19
19
|
const { isForClientSide, isClientRouting } = idParsed;
|
|
20
|
-
(0, utils_js_1.assert)(isForClientSide === !(0,
|
|
20
|
+
(0, utils_js_1.assert)(isForClientSide === !(0, isViteServerBuild_js_1.isViteServerBuild_options)(options));
|
|
21
21
|
const code = await getCode(config, vikeConfig, isForClientSide, isClientRouting, isDev, id);
|
|
22
22
|
return code;
|
|
23
23
|
}
|
|
@@ -74,7 +74,7 @@ ${await (0, getVirtualFilePageConfigs_js_1.getVirtualFilePageConfigs)(isForClien
|
|
|
74
74
|
|
|
75
75
|
`;
|
|
76
76
|
// We still use import.meta.glob() when using th V1 design in order to not break the V1 design deprecation warning
|
|
77
|
-
const isV1Design =
|
|
77
|
+
const isV1Design = (0, getVikeConfig_js_1.isV1Design)(config);
|
|
78
78
|
// Old design => no + files => only to enable pre-rendering is setting `vike({prerender})` in vite.config.js
|
|
79
79
|
const isPrerendering = !!vikeConfig.global.config.prerender;
|
|
80
80
|
fileTypes_js_1.fileTypes
|
|
@@ -26,11 +26,8 @@ function importUserCode() {
|
|
|
26
26
|
vikeConfig = await (0, getVikeConfig_js_1.getVikeConfig)(config_);
|
|
27
27
|
config = config_;
|
|
28
28
|
// TODO/v1-release: remove
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (!isV1)
|
|
32
|
-
config.experimental.importGlobRestoreExtension = true;
|
|
33
|
-
}
|
|
29
|
+
if (!(0, getVikeConfig_js_1.isV1Design)(config))
|
|
30
|
+
config.experimental.importGlobRestoreExtension = true;
|
|
34
31
|
},
|
|
35
32
|
resolveId(id) {
|
|
36
33
|
if ((0, virtual_files_js_1.isVirtualFileId)(id)) {
|
|
@@ -91,8 +91,9 @@ async function getVikeConfigEntry(userRootDir, isDev, vikeVitePluginOptions, doN
|
|
|
91
91
|
}
|
|
92
92
|
return await vikeConfigPromise;
|
|
93
93
|
}
|
|
94
|
-
|
|
95
|
-
const vikeConfig =
|
|
94
|
+
function isV1Design(config) {
|
|
95
|
+
const vikeConfig = config._vikeConfigObject;
|
|
96
|
+
(0, utils_js_1.assert)(vikeConfig);
|
|
96
97
|
const { pageConfigs } = vikeConfig;
|
|
97
98
|
const isV1Design = pageConfigs.length > 0;
|
|
98
99
|
return isV1Design;
|
|
@@ -8,7 +8,7 @@ const extractAssetsQuery_js_1 = require("../../../../../shared/extractAssetsQuer
|
|
|
8
8
|
const debug_js_1 = require("./debug.js");
|
|
9
9
|
const isRuntimeEnvMatch_js_1 = require("./isRuntimeEnvMatch.js");
|
|
10
10
|
const serializeConfigValues_js_1 = require("../../../../../../shared/page-configs/serialize/serializeConfigValues.js");
|
|
11
|
-
const
|
|
11
|
+
const handleAssetsManifest_js_1 = require("../../../build/handleAssetsManifest.js");
|
|
12
12
|
const getConfigValueBuildTime_js_1 = require("../../../../../../shared/page-configs/getConfigValueBuildTime.js");
|
|
13
13
|
async function getVirtualFilePageConfigValuesAll(id, isDev, config) {
|
|
14
14
|
const result = (0, virtualFilePageConfigValuesAll_js_1.isVirtualFileIdPageConfigValuesAll)(id);
|
|
@@ -26,11 +26,11 @@ async function getVirtualFilePageConfigValuesAll(id, isDev, config) {
|
|
|
26
26
|
(0, utils_js_1.assert)(pageConfig, { id, pageId });
|
|
27
27
|
const code = getLoadConfigValuesAll(pageConfig, isForClientSide, pageId,
|
|
28
28
|
// TODO/now: add meta.default
|
|
29
|
-
vikeConfig.global.config.includeAssetsImportedByServer ?? true, isDev);
|
|
29
|
+
vikeConfig.global.config.includeAssetsImportedByServer ?? true, config, isDev);
|
|
30
30
|
(0, debug_js_1.debug)(id, isForClientSide ? 'CLIENT-SIDE' : 'SERVER-SIDE', code);
|
|
31
31
|
return code;
|
|
32
32
|
}
|
|
33
|
-
function getLoadConfigValuesAll(pageConfig, isForClientSide, pageId, includeAssetsImportedByServer, isDev) {
|
|
33
|
+
function getLoadConfigValuesAll(pageConfig, isForClientSide, pageId, includeAssetsImportedByServer, config, isDev) {
|
|
34
34
|
const lines = [];
|
|
35
35
|
const importStatements = [];
|
|
36
36
|
const filesEnv = new Map();
|
|
@@ -38,7 +38,7 @@ function getLoadConfigValuesAll(pageConfig, isForClientSide, pageId, includeAsse
|
|
|
38
38
|
lines.push('export const configValuesSerialized = {');
|
|
39
39
|
lines.push(...(0, serializeConfigValues_js_1.serializeConfigValues)(pageConfig, importStatements, filesEnv, (configEnv) => (0, isRuntimeEnvMatch_js_1.isRuntimeEnvMatch)(configEnv, { isForClientSide, isClientRouting, isDev }), '', false));
|
|
40
40
|
lines.push('};');
|
|
41
|
-
if (!(0,
|
|
41
|
+
if (!(0, handleAssetsManifest_js_1.handleAssetsManifest_isFixEnabled)(config) && includeAssetsImportedByServer && isForClientSide && !isDev) {
|
|
42
42
|
importStatements.push(`import '${(0, extractAssetsQuery_js_1.extractAssetsAddQuery)((0, virtualFilePageConfigValuesAll_js_1.getVirtualFileIdPageConfigValuesAll)(pageId, false))}'`);
|
|
43
43
|
}
|
|
44
44
|
const code = [...importStatements, ...lines].join('\n');
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getFullBuildInlineConfig = getFullBuildInlineConfig;
|
|
4
4
|
const isViteCliCall_js_1 = require("./isViteCliCall.js");
|
|
5
|
+
// TODO/now: move
|
|
5
6
|
function getFullBuildInlineConfig(config) {
|
|
6
7
|
const configFromCli = !(0, isViteCliCall_js_1.isViteCliCall)() ? null : (0, isViteCliCall_js_1.getViteConfigFromCli)();
|
|
7
8
|
if (config._viteConfigEnhanced) {
|