@@ -76,19 +76,17 @@ const createInternalContext = async (moduleOptions: ModuleOptions, nuxt = useNux |
76 | 76 | if (!importDirs.includes(utilsDir)) importDirs.push(utilsDir) |
77 | 77 |
|
78 | 78 | const isLayer = rootDir !== nuxt.options.rootDir |
79 | | - const rootProjectFiles: string[] = [] |
80 | 79 |
|
81 | | - if (!isLayer) { |
82 | | - const pageFiles = pagesContentPath.tryUse() |
| 80 | + const pagePaths: string[] = [] |
| 81 | + const pageFiles = pagesContentPath.tryUse() |
83 | 82 |
|
84 | | - if (moduleOptions.experimental?.strictScanContentPaths && pageFiles && pageFiles.length) { |
85 | | - // replace filenames like [...path].vue with ?...path?.vue because [ and ] are reserved in glob matching |
86 | | - rootProjectFiles.push(...pageFiles.map(p => p.replaceAll(/\[(\.+)([^.].*)\]/g, '?$1$2?'))) |
87 | | - } |
88 | | - // @ts-expect-error pages can be an object |
89 | | - else if (nuxtOptions.pages !== false && nuxtOptions.pages?.enabled !== false) { |
90 | | - rootProjectFiles.push(withSrcDir(`${nuxtOptions.dir?.pages || 'pages'}/**/*${sfcExtensions}`)) |
91 | | - } |
| 83 | + if (moduleOptions.experimental?.strictScanContentPaths && pageFiles && pageFiles.length) { |
| 84 | + // replace filenames like [...path].vue with ?...path?.vue because [ and ] are reserved in glob matching |
| 85 | + if (!isLayer) pagePaths.push(...pageFiles.map(p => p.replaceAll(/\[(\.+)([^.].*)\]/g, '?$1$2?'))) |
| 86 | + } |
| 87 | + // @ts-expect-error pages can be an object |
| 88 | + else if (nuxtOptions.pages !== false && nuxtOptions.pages?.enabled !== false) { |
| 89 | + pagePaths.push(withSrcDir(`${nuxtOptions.dir?.pages || 'pages'}/**/*${sfcExtensions}`)) |
92 | 90 | } |
93 | 91 |
|
94 | 92 | const componentPaths: string[] = [] |
@@ -120,7 +118,7 @@ const createInternalContext = async (moduleOptions: ModuleOptions, nuxt = useNux |
120 | 118 | nuxtOptions.dir?.layouts && withSrcDir(`${nuxtOptions.dir.layouts}/**/*${sfcExtensions}`), |
121 | 119 | nuxtOptions.dir?.plugins && withSrcDir(`${nuxtOptions.dir.plugins}/**/*${defaultExtensions}`), |
122 | 120 | ...importDirs.map(d => `${d}/**/*${defaultExtensions}`), |
123 | | - ...rootProjectFiles, |
| 121 | + ...pagePaths, |
124 | 122 |
|
125 | 123 | withSrcDir(`{A,a}pp${sfcExtensions}`), |
126 | 124 | withSrcDir(`{E,e}rror${sfcExtensions}`), |
|