Skip to content

Commit 8ed215c

Browse files
authored
Merge pull request #76 from kuflash/develop
Release 1.1.4
2 parents 2c73745 + ff8aa00 commit 8ed215c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ class Sitemap {
124124
save(dist, publicPath = '/') {
125125
const sitemapPaths = [];
126126

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+
127135
this.sitemaps.map((sitemap, index) => {
128136
const savePath = dist.replace('.xml', `-${index}.xml`);
129137

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-sitemap",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "Module to generate a sitemap for react-router configuration",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)