chore(v2): remove hardcoded references to config filename

This commit is contained in:
Yangshun Tay 2019-02-23 11:59:44 -08:00
parent 7dae4bd0d1
commit c46a894a01
8 changed files with 96 additions and 64 deletions

View file

@ -5,6 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
const loadConfig = require('../load/config');
const sitemap = require('sitemap');
module.exports = async function createSitemap({
@ -22,7 +23,9 @@ module.exports = async function createSitemap({
const {url: siteUrl} = siteConfig;
if (!siteUrl) {
throw new Error('Url in docusaurus.config.js cannot be empty/undefined');
throw new Error(
`Url in ${loadConfig.configFileName} cannot be empty/undefined`,
);
}
const urls = [];