vue-cli-plugin-sitemap icon indicating copy to clipboard operation
vue-cli-plugin-sitemap copied to clipboard

Override created sitemap

Open marcodarko opened this issue 3 years ago • 2 comments

Docs mention to run npm run sitemap to inspect the output and this follows the config, but when the sitemap already exists is there a way to override it programmatically ? When I run the same command it doesn't seem to change the output rather ignores it. My use case is that I need to generate/update this sitemap daily and need to override it.

marcodarko avatar Apr 23 '21 20:04 marcodarko

Indeed, the file should be overridden. I haven't tested it but this line is probably the culprit: https://github.com/cheap-glitch/vue-cli-plugin-sitemap/blob/ad560f8d6ea4aaf7480443fecb744f80e6df9862/index.js#L89

As a workaround, maybe you could add a npm script that would run the following commands:

rm -f path/to/your/sitemap.xml && vue-cli-service sitemap

cheap-glitch avatar Apr 26 '21 15:04 cheap-glitch

Thanks for responding to my issue! I'll keep an eye out for this fix, in the meantime I'll take your advice and remove it that way.

marcodarko avatar Apr 26 '21 17:04 marcodarko