Skip to content

Commit

Permalink
fix(sitemap): remove debug if sitemap disabled (withastro#2514)
Browse files Browse the repository at this point in the history
  • Loading branch information
markpinero authored Feb 3, 2022
1 parent ade996c commit 81238bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/astro/src/core/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 81238bf

Please sign in to comment.