We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2c73745 + ff8aa00 commit 8ed215cCopy full SHA for 8ed215c
lib/index.js
@@ -124,6 +124,14 @@ class Sitemap {
124
save(dist, publicPath = '/') {
125
const sitemapPaths = [];
126
127
+ // sitemap index is not needed in case of one sitemap file
128
+ if (this.sitemaps.length === 1) {
129
+ // write sitemap
130
+ fs.writeFileSync(dist, this.sitemaps[0].toString());
131
+
132
+ return this;
133
+ }
134
135
this.sitemaps.map((sitemap, index) => {
136
const savePath = dist.replace('.xml', `-${index}.xml`);
137
package.json
@@ -1,6 +1,6 @@
1
{
2
"name": "react-router-sitemap",
3
- "version": "1.1.3",
+ "version": "1.1.4",
4
"description": "Module to generate a sitemap for react-router configuration",
5
"repository": {
6
"type": "git",
0 commit comments