mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 17:07:08 +02:00
fix(v2): Use writeFileSync
to write generated sitemap.xml to avoid early termination (#2530)
This commit is contained in:
parent
84baab33b4
commit
46452350df
1 changed files with 5 additions and 5 deletions
|
@ -36,11 +36,11 @@ export default function pluginSitemap(
|
|||
|
||||
// Write sitemap file.
|
||||
const sitemapPath = path.join(outDir, 'sitemap.xml');
|
||||
fs.writeFile(sitemapPath, generatedSitemap, err => {
|
||||
if (err) {
|
||||
throw new Error(`Sitemap error: ${err}`);
|
||||
}
|
||||
});
|
||||
try {
|
||||
fs.writeFileSync(sitemapPath, generatedSitemap);
|
||||
} catch (err) {
|
||||
throw new Error(`Sitemap error: ${err}`);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue