Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/astro/src/config/entrypoint.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// IMPORTANT: this file is the entrypoint for "astro/config". Keep it as light as possible!

import type { SharpImageServiceConfig } from '../assets/services/sharp.js';

export { createConsoleLogger, createNodeLogger } from '../core/config/index.js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to export this from here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. It's not needed anymore


import type { ImageServiceConfig } from '../types/public/index.js';

export { defineAstroFontProvider, fontProviders } from '../assets/fonts/providers/index.js';
Expand Down
15 changes: 8 additions & 7 deletions packages/astro/src/container/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,15 @@ function createManifest(
};
}

const root = new URL(import.meta.url);
return {
hrefRoot: import.meta.url,
srcDir: manifest?.srcDir ?? ASTRO_CONFIG_DEFAULTS.srcDir,
buildClientDir: manifest?.buildClientDir ?? ASTRO_CONFIG_DEFAULTS.build.client,
buildServerDir: manifest?.buildServerDir ?? ASTRO_CONFIG_DEFAULTS.build.server,
publicDir: manifest?.publicDir ?? ASTRO_CONFIG_DEFAULTS.publicDir,
outDir: manifest?.outDir ?? ASTRO_CONFIG_DEFAULTS.outDir,
cacheDir: manifest?.cacheDir ?? ASTRO_CONFIG_DEFAULTS.cacheDir,
rootDir: root,
srcDir: manifest?.srcDir ?? new URL(ASTRO_CONFIG_DEFAULTS.srcDir, root),
buildClientDir: manifest?.buildClientDir ?? new URL(ASTRO_CONFIG_DEFAULTS.build.client, root),
buildServerDir: manifest?.buildServerDir ?? new URL(ASTRO_CONFIG_DEFAULTS.build.server, root),
publicDir: manifest?.publicDir ?? new URL(ASTRO_CONFIG_DEFAULTS.publicDir, root),
outDir: manifest?.outDir ?? new URL(ASTRO_CONFIG_DEFAULTS.outDir, root),
cacheDir: manifest?.cacheDir ?? new URL(ASTRO_CONFIG_DEFAULTS.cacheDir, root),
trailingSlash: manifest?.trailingSlash ?? ASTRO_CONFIG_DEFAULTS.trailingSlash,
buildFormat: manifest?.buildFormat ?? ASTRO_CONFIG_DEFAULTS.build.format,
compressHTML: manifest?.compressHTML ?? ASTRO_CONFIG_DEFAULTS.compressHTML,
Expand Down
4 changes: 4 additions & 0 deletions packages/astro/src/content/types-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { bold, cyan } from 'kleur/colors';
import { glob } from 'tinyglobby';
import {
type DevEnvironment,
isRunnableDevEnvironment,
normalizePath,
type RunnableDevEnvironment,
type ViteDevServer,
Expand Down Expand Up @@ -347,6 +348,9 @@ export async function createContentTypesGenerator({
logger,
settings,
});
if (!isRunnableDevEnvironment(viteServer.environments.ssr)) {
return;
}
invalidateVirtualMod(viteServer.environments.ssr);
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/astro/src/core/app/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ export abstract class BaseApp<P extends Pipeline = AppPipeline> {
pathname = prependForwardSlash(this.removeBase(url.pathname));
}
let routeData = matchRoute(decodeURI(pathname), this.manifestData);

if (!routeData) return undefined;
if (allowPrerenderedRoutes) {
return routeData;
Expand Down
7 changes: 7 additions & 0 deletions packages/astro/src/core/app/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ export function deserializeManifest(
return { onRequest: NOOP_MIDDLEWARE_FN };
},
...serializedManifest,
rootDir: new URL(serializedManifest.rootDir),
srcDir: new URL(serializedManifest.srcDir),
publicDir: new URL(serializedManifest.publicDir),
outDir: new URL(serializedManifest.outDir),
cacheDir: new URL(serializedManifest.cacheDir),
buildClientDir: new URL(serializedManifest.buildClientDir),
buildServerDir: new URL(serializedManifest.buildServerDir),
assets,
componentMetadata,
inlinedScripts,
Expand Down
Loading
Loading