nuxt-community / sitemap-module

Sitemap Module for Nuxt 2
https://sitemap.nuxtjs.org
MIT License
688 stars 127 forks source link

Hooks are not firing #223

Open ToonFroeyenDEV opened 3 years ago

ToonFroeyenDEV commented 3 years ago

Using dynamic routes with multiple locales is not possible unless you use static locales (https://github.com/nuxt-community/sitemap-module/issues/122). We are trying to fix this by using the hooks sitemap:generate:done or sitemap:generate:before as stated on (https://sitemap.nuxtjs.org/usage/hooks) But these aren't firing either.

generator.js export default function (_) { this.nuxt.hook('sitemap:generate:done', (nuxt) => { console.log('Fire sitemap generate hook') }) }

nuxt.extend.js buildModules: ['modules/project-extend', 'modules/sitemapRouteGenerator'],

mryshakow commented 2 years ago

Same here:

package.json

"dependencies": {
   ...
    "@nuxtjs/sitemap": "^2.4.0",
   ...

nuxt.config.js

hooks: {
    sitemap: {
      generate: {
        before(nuxt, sitemapOptions) {
          console.log('This wont fire.')
        },
        done(nuxt) {
          console.log('This neither')
        }
      }
    }
  },

Rest works fine and as intended. What am I missing?