Skip to content

Commit

Permalink
perf(v2): convert synchronous filewrite to asynchronous in sitemap ge…
Browse files Browse the repository at this point in the history
…nerate
  • Loading branch information
moonrailgun committed Jun 15, 2020
1 parent 053c507 commit 41d13d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/docusaurus-plugin-sitemap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import fs from 'fs';
import fs from 'fs-extra';
import path from 'path';
import {PluginOptions} from './types';
import createSitemap from './createSitemap';
Expand Down Expand Up @@ -37,7 +37,7 @@ export default function pluginSitemap(
// Write sitemap file.
const sitemapPath = path.join(outDir, 'sitemap.xml');
try {
fs.writeFileSync(sitemapPath, generatedSitemap);
await fs.outputFile(sitemapPath, generatedSitemap);
} catch (err) {
throw new Error(`Sitemap error: ${err}`);
}
Expand Down

0 comments on commit 41d13d5

Please sign in to comment.