diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index 4ada4f9a8..06ce9d7ee 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -289,12 +289,11 @@ async function runPostBuildHooks( const config = container.options.settings.config; const buildConfig = container.options.settings.config.build; for (const [fileName, mutation] of mutations) { - const root = - isServerLikeOutput(config) - ? mutation.build === 'server' - ? buildConfig.server - : buildConfig.client - : config.outDir; + const root = isServerLikeOutput(config) + ? mutation.build === 'server' + ? buildConfig.server + : buildConfig.client + : config.outDir; const fileURL = new URL(fileName, root); await fs.promises.mkdir(new URL('./', fileURL), { recursive: true }); await fs.promises.writeFile(fileURL, mutation.code, 'utf-8'); diff --git a/packages/astro/src/core/util.ts b/packages/astro/src/core/util.ts index 67f5590d3..11e792b78 100644 --- a/packages/astro/src/core/util.ts +++ b/packages/astro/src/core/util.ts @@ -139,9 +139,7 @@ export function isEndpoint(file: URL, settings: AstroSettings): boolean { } export function isModeServerWithNoAdapter(settings: AstroSettings): boolean { - return ( - isServerLikeOutput(settings.config) && !settings.adapter - ); + return isServerLikeOutput(settings.config) && !settings.adapter; } export function relativeToSrcDir(config: AstroConfig, idOrUrl: URL | string) { diff --git a/packages/astro/src/integrations/index.ts b/packages/astro/src/integrations/index.ts index 6beb8e7b8..0d8cd6700 100644 --- a/packages/astro/src/integrations/index.ts +++ b/packages/astro/src/integrations/index.ts @@ -339,8 +339,7 @@ export async function runHookBuildGenerated({ buildConfig: BuildConfig; logging: LogOptions; }) { - const dir = - isServerLikeOutput(config) ? buildConfig.client : config.outDir; + const dir = isServerLikeOutput(config) ? buildConfig.client : config.outDir; for (const integration of config.integrations) { if (integration?.hooks?.['astro:build:generated']) { @@ -366,8 +365,7 @@ export async function runHookBuildDone({ routes: RouteData[]; logging: LogOptions; }) { - const dir = - isServerLikeOutput(config) ? buildConfig.client : config.outDir; + const dir = isServerLikeOutput(config) ? buildConfig.client : config.outDir; await fs.promises.mkdir(dir, { recursive: true }); for (const integration of config.integrations) {