@@ -106,6 +106,7 @@ export default defineNuxtModule<ModuleOptions>({
106106      return  selectedForm . trim ( ) . replace ( '{count}' ,  count . toString ( ) ) 
107107    } , 
108108    customRegexMatcher : undefined , 
109+     excludePatterns : undefined , 
109110  } , 
110111  async  setup ( options ,  nuxt )  { 
111112    const  defaultLocale  =  process . env . DEFAULT_LOCALE  ??  options . defaultLocale  ??  'en' 
@@ -130,7 +131,7 @@ export default defineNuxtModule<ModuleOptions>({
130131    const  rootDirs  =  nuxt . options . _layers . map ( layer  =>  layer . config . rootDir ) . reverse ( ) 
131132
132133    const  localeManager  =  new  LocaleManager ( options ,  rootDirs ) 
133-     const  pageManager  =  new  PageManager ( localeManager . locales ,  defaultLocale ,  options . strategy ! ,  options . globalLocaleRoutes ,  options . noPrefixRedirect ! ) 
134+     const  pageManager  =  new  PageManager ( localeManager . locales ,  defaultLocale ,  options . strategy ! ,  options . globalLocaleRoutes ,  options . noPrefixRedirect ! ,   options . excludePatterns ) 
134135
135136    addTemplate ( { 
136137      filename : 'i18n.plural.mjs' , 
@@ -158,6 +159,7 @@ export default defineNuxtModule<ModuleOptions>({
158159      isSSG : isSSG , 
159160      disablePageLocales : options . disablePageLocales  ??  false , 
160161      canonicalQueryWhitelist : options . canonicalQueryWhitelist  ??  [ ] , 
162+       excludePatterns : options . excludePatterns  ??  [ ] , 
161163    } 
162164
163165    // if there is a customRegexMatcher set and all locales don't match the custom matcher, throw error 
@@ -294,7 +296,7 @@ export default defineNuxtModule<ModuleOptions>({
294296            const  fullPath  =  path . posix . normalize ( `${ parentPath } ${ page . path }  )  // Combine parent path and current path 
295297
296298            // Skip internal paths 
297-             if  ( isInternalPath ( fullPath ) )  { 
299+             if  ( isInternalPath ( fullPath ,   options . excludePatterns ) )  { 
298300              return 
299301            } 
300302
@@ -328,15 +330,15 @@ export default defineNuxtModule<ModuleOptions>({
328330                  } 
329331
330332                  // Add localized path to array 
331-                   if  ( ! isInternalPath ( localizedPath ) )  { 
333+                   if  ( ! isInternalPath ( localizedPath ,   options . excludePatterns ) )  { 
332334                    prerenderRoutes . push ( localizedPath ) 
333335                  } 
334336                } 
335337              } ) 
336338            } 
337339            else  { 
338340              // If there's no dynamic locale segment in the path, just add it to the array 
339-               if  ( ! isInternalPath ( fullPath ) )  { 
341+               if  ( ! isInternalPath ( fullPath ,   options . excludePatterns ) )  { 
340342                prerenderRoutes . push ( fullPath ) 
341343              } 
342344            } 
@@ -514,7 +516,7 @@ export default defineNuxtModule<ModuleOptions>({
514516      // Remove internal paths before localization processing 
515517      const  routesToRemove : string [ ]  =  [ ] 
516518      routesSet . forEach ( ( route )  =>  { 
517-         if  ( isInternalPath ( route ) )  { 
519+         if  ( isInternalPath ( route ,   options . excludePatterns ) )  { 
518520          routesToRemove . push ( route ) 
519521        } 
520522      } ) 
@@ -525,7 +527,7 @@ export default defineNuxtModule<ModuleOptions>({
525527
526528      // Go through each existing route and add localized versions 
527529      routesSet . forEach ( ( route )  =>  { 
528-         if  ( ! / \. [ a - z 0 - 9 ] + $ / i. test ( route )  &&  ! isInternalPath ( route ) )  { 
530+         if  ( ! / \. [ a - z 0 - 9 ] + $ / i. test ( route )  &&  ! isInternalPath ( route ,   options . excludePatterns ) )  { 
529531          localeManager . locales ! . forEach ( ( locale )  =>  { 
530532            // For prefix and prefix_and_default strategies generate routes for defaultLocale too 
531533            // For prefix_except_default strategy skip defaultLocale 
0 commit comments