d3xter-dev / sitemap-module-nuxt-3

Sitemap Module for Nuxt 3
https://sitemap.nuxtjs.org
MIT License
63 stars 12 forks source link

Sitemap only generated when 'nuxi generate' is used #6

Closed szwenni closed 2 years ago

szwenni commented 2 years ago

Hi,

If I use 'nuxi build' the sitemap is not generated like it should. I now patched it manually to execute always (build/generate).

Is there any problem with doing it on both commands ? Because for me it worked on both. Maybe also an config flag could be inserted to control this behavior.

BR, Sven

rcerljenko commented 2 years ago

hi @szwenni , i have the same problem.. how did you manage to patch it to work with build command?

szwenni commented 2 years ago

Hi,

actually I created a fork right now and pushed it to npm. I don't know if it works in every case but for me it works like expected.

https://github.com/szwenni/sitemap-module-nuxt-3 https://www.npmjs.com/package/@szwenni/sitemap-nuxt-3

Sorry but I did not really care about everything else till now. Just wanted to have the functionality I need.

BR, Sven

arsors commented 2 years ago

I had a quick look into the module and it looks like the sitemap was never automatically generated on the build command. I ask myself if it would be possible to use the crawler in build (SSR) mode as well? @d3xter-dev @NicoPennec

d3xter-dev commented 2 years ago

That the sitemap is only generated as a file when using "nuxi generate" is the expected behavior. When using the normal build the middleware will generate the XML when /sitemap.xml is requested.