nuxt-community / sitemap-module

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

Sitemap renders .vue & .js files, how can i exclude those .js ? #245

Open YsarocK opened 2 years ago

YsarocK commented 2 years ago

Hello !

I'm trying to use the sitemap module (which is, except this, quite usefull). My pages folders are like this : /pages/reservation/index.vue with external .js & .scss files.

In the sitemap, i have both /reservation & /reservation/reservation created routes.

I've tried to exclude "*/**.js" in nuxt.config.js.

Am i missing something ?

Thanks for your help !

urbgimtam commented 2 years ago

In sitemap options inside nuxt.config.js, you can exclude with the following syntax:

sitemap: {
  exclude: [
    '/**/*.js',        // this should work
    '/reservation/**/*.js',    //  this should also work
    '/secret', 
    '/admin/**', 
    '/graphql/**', 
  ],
  defaults: {
    // ...
  }
}