Skip to content

Commit

Permalink
dir now matches client output
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanM04 committed Apr 6, 2022
1 parent debdf11 commit 6753160
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/astro/src/core/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ class AstroBuilder {
await viteServer.close();
await runHookBuildDone({
config: this.config,
buildConfig,
pages: pageNames,
routes: Object.values(allPages).map((pd) => pd.route),
});
Expand Down
7 changes: 6 additions & 1 deletion packages/astro/src/integrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { AstroConfig, AstroRenderer, BuildConfig, RouteData } from '../@types/as
import { mergeConfig } from '../core/config.js';
import ssgAdapter from '../adapter-ssg/index.js';
import type { ViteConfigWithSSR } from '../core/create-vite.js';
import { isBuildingToSSR } from '../core/util.js';

export async function runHookConfigSetup({
config: _config,
Expand Down Expand Up @@ -136,18 +137,22 @@ export async function runHookBuildSetup({

export async function runHookBuildDone({
config,
buildConfig,
pages,
routes,
}: {
config: AstroConfig;
buildConfig: BuildConfig;
pages: string[];
routes: RouteData[];
}) {
const dir = isBuildingToSSR(config) ? buildConfig.client : config.outDir;

for (const integration of config.integrations) {
if (integration.hooks['astro:build:done']) {
await integration.hooks['astro:build:done']({
pages: pages.map((p) => ({ pathname: p })),
dir: config.outDir,
dir,
routes,
});
}
Expand Down

0 comments on commit 6753160

Please sign in to comment.