vike 0.4.245-commit-6880dc7 → 0.4.245-commit-292c95d
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/esm/__internal/index.js +2 -2
- package/dist/esm/node/runtime/globalContext.js +2 -1
- package/dist/esm/node/vite/shared/resolveVikeConfigInternal.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.d.ts +2 -2
- package/dist/esm/utils/assertSetup.js +17 -6
- package/package.json +2 -2
|
@@ -4,14 +4,14 @@ export { setGlobalContext_prodBuildEntry } from '../node/runtime/globalContext.j
|
|
|
4
4
|
export { route, getPagesAndRoutes };
|
|
5
5
|
import { route as routeInternal } from '../shared/route/index.js';
|
|
6
6
|
import { getGlobalContextServerInternal, initGlobalContext_getPagesAndRoutes } from '../node/runtime/globalContext.js';
|
|
7
|
-
import {
|
|
7
|
+
import { setNodeEnvProductionIfUndefined } from '../utils/assertSetup.js';
|
|
8
8
|
/**
|
|
9
9
|
* Used by {@link https://github.com/magne4000/vite-plugin-vercel|vite-plugin-vercel} to compute some rewrite rules and extract { isr } configs.
|
|
10
10
|
*
|
|
11
11
|
* TO-DO/eventually: remove
|
|
12
12
|
*/
|
|
13
13
|
async function getPagesAndRoutes() {
|
|
14
|
-
|
|
14
|
+
setNodeEnvProductionIfUndefined();
|
|
15
15
|
await initGlobalContext_getPagesAndRoutes();
|
|
16
16
|
const { globalContext } = await getGlobalContextServerInternal();
|
|
17
17
|
const {
|
|
@@ -29,7 +29,7 @@ export { vikeConfigErrorRecoverMsg };
|
|
|
29
29
|
// - Without vike-server it's manually loaded here using importServerProductionEntry() which uses @brillout/vite-plugin-server-entry's autoImporter or crawler
|
|
30
30
|
// - In development: globalObject.viteDevServer which is Vite's development server
|
|
31
31
|
// - globalObject.viteDevServer is used by updateUserFiles() which then sets virtualFileExportsGlobalEntry
|
|
32
|
-
import { assert, onSetupRuntime, assertUsage, assertWarning, isPlainObject, objectReplace, isObject, hasProp, getGlobalObject, genPromise, createDebugger, checkType, PROJECT_VERSION, getViteRPC, isRunnableDevEnvironment, assertIsNotBrowser, isNonRunnableDev, objectAssign, } from './utils.js';
|
|
32
|
+
import { assert, onSetupRuntime, assertUsage, assertWarning, isPlainObject, objectReplace, isObject, hasProp, getGlobalObject, genPromise, createDebugger, checkType, PROJECT_VERSION, getViteRPC, isRunnableDevEnvironment, assertIsNotBrowser, isNonRunnableDev, objectAssign, setNodeEnvProductionIfUndefined, } from './utils.js';
|
|
33
33
|
import { importServerProductionEntry } from '@brillout/vite-plugin-server-entry/runtime';
|
|
34
34
|
import { virtualFileIdGlobalEntryServer } from '../shared/virtualFileId.js';
|
|
35
35
|
import pc from '@brillout/picocolors';
|
|
@@ -270,6 +270,7 @@ async function setGlobalContext_prodBuildEntry(prodBuildEntry) {
|
|
|
270
270
|
debug('setGlobalContext_prodBuildEntry()');
|
|
271
271
|
assert(!isNonRunnableDev());
|
|
272
272
|
assertProdBuildEntry(prodBuildEntry);
|
|
273
|
+
setNodeEnvProductionIfUndefined();
|
|
273
274
|
globalObject.prodBuildEntry = prodBuildEntry;
|
|
274
275
|
globalObject.prodBuildEntryPrevious = prodBuildEntry;
|
|
275
276
|
assert(globalObject.prodBuildEntry); // ensure no infinite loop
|
|
@@ -799,7 +799,7 @@ function assertMetaUsage(metaVal, metaConfigDefinedAt) {
|
|
|
799
799
|
}
|
|
800
800
|
});
|
|
801
801
|
}
|
|
802
|
-
// Test: https://github.com/vikejs/vike/blob/
|
|
802
|
+
// Test: https://github.com/vikejs/vike/blob/871a111a77d637bbd156b07be5ae728c3d595501/test/playground/pages/config-meta/effect/e2e-test.ts
|
|
803
803
|
function applyEffects(configValueSources, configDefinitions, plusFilesAll) {
|
|
804
804
|
objectEntries(configDefinitions).forEach(([configNameEffect, configDefEffect]) => {
|
|
805
805
|
const sourceEffect = configValueSources[configNameEffect]?.[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.245-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.245-commit-292c95d";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.245-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.245-commit-292c95d';
|
|
@@ -3,7 +3,7 @@ export { onSetupRuntime };
|
|
|
3
3
|
export { onSetupBuild };
|
|
4
4
|
export { onSetupPrerender };
|
|
5
5
|
export { onSetupPreview };
|
|
6
|
-
export {
|
|
6
|
+
export { setNodeEnvProductionIfUndefined };
|
|
7
7
|
export { markSetup_viteDevServer };
|
|
8
8
|
export { markSetup_vitePreviewServer };
|
|
9
9
|
export { markSetup_vikeVitePlugin };
|
|
@@ -17,4 +17,4 @@ declare function markSetup_viteDevServer(): void | undefined;
|
|
|
17
17
|
declare function markSetup_vitePreviewServer(): void | undefined;
|
|
18
18
|
declare function markSetup_vikeVitePlugin(): void;
|
|
19
19
|
declare function markSetup_isViteDev(isViteDev: boolean): void;
|
|
20
|
-
declare function
|
|
20
|
+
declare function setNodeEnvProductionIfUndefined(): void | undefined;
|
|
@@ -3,7 +3,7 @@ export { onSetupRuntime };
|
|
|
3
3
|
export { onSetupBuild };
|
|
4
4
|
export { onSetupPrerender };
|
|
5
5
|
export { onSetupPreview };
|
|
6
|
-
export {
|
|
6
|
+
export { setNodeEnvProductionIfUndefined };
|
|
7
7
|
export { markSetup_viteDevServer };
|
|
8
8
|
export { markSetup_vitePreviewServer };
|
|
9
9
|
export { markSetup_vikeVitePlugin };
|
|
@@ -55,7 +55,7 @@ function onSetupRuntime() {
|
|
|
55
55
|
function onSetupBuild() {
|
|
56
56
|
assertUsageNodeEnvIsNotDev('building');
|
|
57
57
|
/* Not needed: Vite already sets `process.env.NODE_ENV = 'production'`
|
|
58
|
-
|
|
58
|
+
setNodeEnvProductionIfUndefined()
|
|
59
59
|
*/
|
|
60
60
|
}
|
|
61
61
|
// Called by ../node/prerender/runPrerender.ts
|
|
@@ -63,7 +63,7 @@ function onSetupPrerender() {
|
|
|
63
63
|
markSetup_isPrerendering();
|
|
64
64
|
if (getNodeEnv())
|
|
65
65
|
assertUsageNodeEnvIsNotDev('pre-rendering');
|
|
66
|
-
|
|
66
|
+
setNodeEnvProductionIfUndefined();
|
|
67
67
|
}
|
|
68
68
|
// Called by ../node/api/preview.ts
|
|
69
69
|
function onSetupPreview() {
|
|
@@ -157,10 +157,21 @@ function getNodeEnv() {
|
|
|
157
157
|
//*/
|
|
158
158
|
return val;
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
// TODO: rename
|
|
161
|
+
function setNodeEnvProductionIfUndefined() {
|
|
161
162
|
// The statement `process.env['NODE_ENV'] = 'production'` chokes webpack v4
|
|
162
|
-
|
|
163
|
+
let val;
|
|
164
|
+
let proc;
|
|
165
|
+
try {
|
|
166
|
+
proc = process;
|
|
167
|
+
val = process.env.NODE_ENV;
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (val !== undefined)
|
|
173
|
+
return;
|
|
163
174
|
const { env } = proc;
|
|
164
|
-
env.NODE_ENV = 'production';
|
|
175
|
+
env.NODE_ENV ?? (env.NODE_ENV = 'production');
|
|
165
176
|
assert(isNodeEnv('production'));
|
|
166
177
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.245-commit-
|
|
3
|
+
"version": "0.4.245-commit-292c95d",
|
|
4
4
|
"repository": "https://github.com/vikejs/vike",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": {
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
"@types/picomatch": "^3.0.2",
|
|
246
246
|
"@types/semver": "^7.5.8",
|
|
247
247
|
"@types/source-map-support": "^0.5.10",
|
|
248
|
-
"react-streaming": "^0.4.
|
|
248
|
+
"react-streaming": "^0.4.12",
|
|
249
249
|
"rimraf": "^5.0.5",
|
|
250
250
|
"typescript": "^5.9.2",
|
|
251
251
|
"vite": "^7.1.5"
|