Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// sitemap-index.xml is default file name. (https://git.io/fhNgG)
const indexFilePath = path.join(
publicPath,
`${rest.sitemapName || `sitemap`}-index.xml`
)
const sitemapIndexOptions = {
...rest,
hostname: hostname || withoutTrailingSlash(siteUrl),
targetFolder: publicPath,
urls,
callback: error => {
if (error) throw new Error(error)
renameFile(indexFilePath, saved).then(resolve)
},
}
sitemap.createSitemapIndex(sitemapIndexOptions)
})
}