chore: cleanup code (#6897)

This commit is contained in:
chlorine 2023-04-24 13:25:03 +08:00 committed by GitHub
parent b6154d2d57
commit b24607069e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -89,7 +89,7 @@ export async function generatePages(opts: StaticBuildOptions, internals: BuildIn
const serverEntry = opts.buildConfig.serverEntry;
const outFolder = ssr ? opts.buildConfig.server : getOutDirWithinCwd(opts.settings.config.outDir);
if (opts.settings.config.output === 'server' && !hasPrerenderedPages(internals)) return;
if (ssr && !hasPrerenderedPages(internals)) return;
const verb = ssr ? 'prerendering' : 'generating';
info(opts.logging, null, `\n${bgGreen(black(` ${verb} static routes `))}`);
@ -98,7 +98,7 @@ export async function generatePages(opts: StaticBuildOptions, internals: BuildIn
const ssrEntry = await import(ssrEntryURL.toString());
const builtPaths = new Set<string>();
if (opts.settings.config.output === 'server') {
if (ssr) {
for (const pageData of eachPrerenderedPageData(internals)) {
await generatePage(opts, internals, pageData, ssrEntry, builtPaths);
}

View file

@ -28,7 +28,7 @@ export function vitePluginSSR(internals: BuildInternals, adapter: AstroAdapter):
options(opts) {
return addRollupInput(opts, [virtualModuleId]);
},
resolveId(id, parent) {
resolveId(id) {
if (id === virtualModuleId) {
return resolvedVirtualModuleId;
}