fix(sitemap): remove debug if sitemap disabled (#2514)
This commit is contained in:
parent
ade996c885
commit
81238bf77d
1 changed files with 2 additions and 2 deletions
|
@ -146,14 +146,14 @@ class AstroBuilder {
|
|||
debug('build', timerMessage('Additional assets copied', timer.assetsStart));
|
||||
|
||||
// Build your final sitemap.
|
||||
timer.sitemapStart = performance.now();
|
||||
if (this.config.buildOptions.sitemap && this.config.buildOptions.site) {
|
||||
timer.sitemapStart = performance.now();
|
||||
const sitemap = generateSitemap(pageNames.map((pageName) => new URL(pageName, this.config.buildOptions.site).href));
|
||||
const sitemapPath = new URL('./sitemap.xml', this.config.dist);
|
||||
await fs.promises.mkdir(new URL('./', sitemapPath), { recursive: true });
|
||||
await fs.promises.writeFile(sitemapPath, sitemap, 'utf8');
|
||||
debug('build', timerMessage('Sitemap built', timer.sitemapStart));
|
||||
}
|
||||
debug('build', timerMessage('Sitemap built', timer.sitemapStart));
|
||||
|
||||
// You're done! Time to clean up.
|
||||
await viteServer.close();
|
||||
|
|
Loading…
Reference in a new issue