Use patch-package or a fork to rename the hook. You can use my working fork in package.json: "@nuxtjs/sitemap": "thisismydesign/sitemap-module#cd4dc22293b9b67e8ebb5b3c49840e67c108e312"
Use a workaround to copy sitemaps into the static folder rather than relying on a middleware to serve them:
How to make this package work on Nuxt 2 Bridge
There are (at least) 2 things that don't seem to work with Nuxt 2 Bridge:
addServerMiddleware
no longer takes a handler functiongenerate:done
hook is renamed tobuild:done
Working solution
Use
patch-package
or a fork to rename the hook. You can use my working fork in package.json:"@nuxtjs/sitemap": "thisismydesign/sitemap-module#cd4dc22293b9b67e8ebb5b3c49840e67c108e312"
Use a workaround to copy sitemaps into the static folder rather than relying on a middleware to serve them:
nuxt.config.ts
The sitemap is now available at
/sitemap.xml
As this is a static file it will only update upon deploy. Keep this in mind for dynamic routes.
How to release this with the package
The hook used and the middleware could be conditional on the dependencies. That would fully support Nuxt 2 Bridge and possibly Nuxt 3 as well.