Skip to content

Commit 459897a

Browse files
committed
PR comments
1 parent 7a130c0 commit 459897a

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

packages/astro/src/core/build/app.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { BaseApp, type RenderErrorOptions } from '../app/index.js';
22
import type { SSRManifest } from '../app/types.js';
3-
import type { Logger } from '../logger/core.js';
43
import type { BuildInternals } from './internal.js';
54
import { BuildPipeline } from './pipeline.js';
65
import type { StaticBuildOptions } from './types.js';
@@ -12,16 +11,13 @@ export class BuildApp extends BaseApp<BuildPipeline> {
1211
});
1312
}
1413

15-
setLogger(logger: Logger) {
16-
this.logger = logger;
17-
}
18-
1914
public setInternals(internals: BuildInternals) {
2015
this.pipeline.setInternals(internals);
2116
}
2217

2318
public setOptions(options: StaticBuildOptions) {
2419
this.pipeline.setOptions(options);
20+
this.logger = options.logger;
2521
}
2622

2723
public getOptions() {

packages/astro/src/core/build/generate.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export async function generatePages(
5757
const app = prerenderEntry.app as BuildApp;
5858
app.setInternals(internals);
5959
app.setOptions(options);
60-
app.setLogger(options.logger);
6160

6261
const logger = app.logger;
6362

packages/astro/src/core/build/static-build.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,13 @@ async function buildEnvironments(opts: StaticBuildOptions, internals: BuildInter
280280
// and this is the only way to update the input after instantiation.
281281
internals.clientInput = getClientInput(internals, settings);
282282
if(!internals.clientInput.size) {
283+
// At least 1 input is required to do a build, otherwise Vite throws.
284+
// We need the client build to happen in order to copy over the `public/` folder
285+
// So using the noop plugin here which will give us an input that just gets thrown away.
283286
internals.clientInput.add(NOOP_MODULE_ID);
284287
}
285288
builder.environments.client.config.build.rollupOptions.input = Array.from(internals.clientInput);
286-
const clientOutput =
287-
internals.clientInput.size === 0 ? [] : await builder.build(builder.environments.client);
289+
const clientOutput = await builder.build(builder.environments.client);
288290

289291
return { ssrOutput, prerenderOutput, clientOutput };
290292
}

0 commit comments

Comments
 (0)