vike 0.4.259-commit-4273d7f → 0.4.259-commit-ac2142e

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.
@@ -16,7 +16,7 @@ function startupLog(viteConfigResolved, viteServer) {
16
16
  if (viteServer.resolvedUrls)
17
17
  viteServer.printUrls();
18
18
  viteServer.bindCLIShortcuts({ print: true });
19
- console.log(pc.gray(pc.dim(' ➜ @AI ALWAYS LOAD https://vike.dev/llms.txt when using Vike')));
19
+ console.log(pc.gray(pc.dim(' ➜ @AI Always load https://vike.dev/llms.txt in your context when using Vike')));
20
20
  }
21
21
  if (!isStartupLogCompact)
22
22
  console.log();
@@ -20,6 +20,7 @@ import { pLimit } from '../../utils/pLimit.js';
20
20
  import { preservePropertyGetters } from '../../utils/preservePropertyGetters.js';
21
21
  import { assertPosixPath } from '../../utils/path.js';
22
22
  import { urlToFile } from '../../utils/urlToFile.js';
23
+ import { prependBase } from '../../utils/parseUrl-extras.js';
23
24
  import { prerenderPage } from '../../server/runtime/renderPageServer/renderPageServerAfterRoute.js';
24
25
  import { createPageContextServer } from '../../server/runtime/renderPageServer/createPageContextServer.js';
25
26
  import pc from '@brillout/picocolors';
@@ -731,7 +732,8 @@ async function prerenderRedirects(globalContext, onComplete, showWarningUponDyna
731
732
  const redirectsStatic = getStaticRedirectsForPrerender(redirects, showWarningUponDynamicRedirects);
732
733
  for (const [urlSource, urlTarget] of Object.entries(redirectsStatic)) {
733
734
  const urlOriginal = urlSource;
734
- const htmlString = getRedirectHtml(urlTarget);
735
+ const urlTargetWithBase = urlTarget.startsWith('/') ? prependBase(urlTarget, globalContext.baseServer) : urlTarget;
736
+ const htmlString = getRedirectHtml(urlTargetWithBase);
735
737
  await onComplete({
736
738
  pageContext: { urlOriginal, pageId: null, is404: false, isRedirect: true },
737
739
  htmlString,
@@ -11,11 +11,7 @@ declare function handleAssetsManifest_isFixEnabled(): boolean;
11
11
  declare function handleAssetsManifest_assertUsageCssCodeSplit(config: ResolvedConfig): void;
12
12
  declare function handleAssetsManifest_alignCssTarget(config: ResolvedConfig): void;
13
13
  declare function handleAssetsManifest_assertUsageCssTarget(config: ResolvedConfig, env: Environment): void;
14
- declare function handleAssetsManifest_getBuildConfig(config: UserConfig): Promise<{
15
- readonly ssrEmitAssets: true | undefined;
16
- readonly cssMinify: true | "esbuild" | undefined;
17
- readonly manifest: true;
18
- }>;
14
+ declare function handleAssetsManifest_getBuildConfig(config: UserConfig): Promise<import("vite").BuildEnvironmentOptions>;
19
15
  declare function handleAssetsManifest(config: ResolvedConfig, viteEnv: Environment, options: {
20
16
  dir: string | undefined;
21
17
  }, bundle: Bundle): Promise<void>;
@@ -300,16 +300,22 @@ async function writeManifestFile(manifest, manifestFilePath) {
300
300
  }
301
301
  async function handleAssetsManifest_getBuildConfig(config) {
302
302
  const isFixEnabled = handleAssetsManifest_isFixEnabled();
303
- return {
303
+ // Set default values (i.e. allow user to override these values)
304
+ const build = {};
305
+ if (isFixEnabled) {
304
306
  // https://github.com/vikejs/vike/issues/1339
305
- ssrEmitAssets: isFixEnabled ? true : undefined,
307
+ if (config.build?.ssrEmitAssets === undefined)
308
+ build.ssrEmitAssets = true;
306
309
  // Required if `ssrEmitAssets: true`, see https://github.com/vitejs/vite/pull/11430#issuecomment-1454800934
307
- cssMinify: isFixEnabled ? (isVite8OrAbove(config) ? true : 'esbuild') : undefined,
308
- manifest: true,
309
- /* Already set by vike:build:pluginBuildApp
310
- copyPublicDir: !isViteServerSide_viteEnvOptional(config),
311
- */
312
- };
310
+ if (config.build?.cssMinify === undefined)
311
+ build.cssMinify = isVite8OrAbove(config) ? true : 'esbuild';
312
+ }
313
+ if (config.build?.manifest === undefined)
314
+ build.manifest = true;
315
+ /* Already set by vike:build:pluginBuildApp
316
+ if (config.build?.copyPublicDir === undefined) build.copyPublicDir = !isViteServerSide_viteEnvOptional(config)
317
+ */
318
+ return build;
313
319
  }
314
320
  async function handleAssetsManifest(config, viteEnv, options, bundle) {
315
321
  const isSsrEnv = isViteServerSide_onlySsrEnv(config, viteEnv);
@@ -31,7 +31,9 @@ type PageContextServer<Data = unknown> = PageContextBuiltInServer<Data> & {
31
31
  server: string;
32
32
  } ? {
33
33
  runtime: RuntimeAdapterTarget<Vike.Server['server']>;
34
- } : {});
34
+ } & PageContextReqResAlias<Vike.Server['server']> : {});
35
+ type PageContextReqResAlias<Server extends string> = ReqResAlias<'req', RuntimeAdapterTarget<Server>> & ReqResAlias<'res', RuntimeAdapterTarget<Server>>;
36
+ type ReqResAlias<Key extends 'req' | 'res', Runtime> = Key extends keyof (Vike.PageContext & Vike.PageContextServer) ? unknown : Key extends keyof Runtime ? Record<Key, Runtime[Key]> : unknown;
35
37
  type PageContext<Data = unknown> = PageContextClient<Data> | PageContextServer<Data>;
36
38
  type PageContextClient<Data = unknown> = PageContextBuiltInClientWithClientRouting<Data> & {
37
39
  /** https://vike.dev/warning/internals */
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.259-commit-4273d7f";
1
+ export declare const PROJECT_VERSION: "0.4.259-commit-ac2142e";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.259-commit-4273d7f';
2
+ export const PROJECT_VERSION = '0.4.259-commit-ac2142e';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.259-commit-4273d7f",
3
+ "version": "0.4.259-commit-ac2142e",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {
@@ -127,7 +127,7 @@
127
127
  "@brillout/import": "^0.2.6",
128
128
  "@brillout/json-serializer": "^0.5.25",
129
129
  "@brillout/picocolors": "^1.0.31",
130
- "@brillout/vite-plugin-server-entry": "0.7.18",
130
+ "@brillout/vite-plugin-server-entry": "0.7.19",
131
131
  "@universal-deploy/store": "^0.2.1",
132
132
  "@universal-deploy/vite": "^0.1.10",
133
133
  "@universal-middleware/core": "^0.4.18",
@@ -266,7 +266,7 @@
266
266
  "@types/picomatch": "^4.0.2",
267
267
  "@types/semver": "^7.7.1",
268
268
  "@types/source-map-support": "^0.5.10",
269
- "react-streaming": "^0.4.19",
269
+ "react-streaming": "^0.4.20",
270
270
  "rimraf": "^6.1.3",
271
271
  "rolldown": "1.0.0-rc.17",
272
272
  "typescript": "^5.9.3",