Skip to content

Commit 4eea740

Browse files
committed
fix(content): revert pages to only app as layers also inherit it
1 parent 3f59d4a commit 4eea740

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

‎src/internal-context/load.ts‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,17 @@ const createInternalContext = async (moduleOptions: ModuleOptions, nuxt = useNux
7676
if(!importDirs.includes(utilsDir))importDirs.push(utilsDir)
7777

7878
constisLayer=rootDir!==nuxt.options.rootDir
79-
constrootProjectFiles: string[]=[]
8079

81-
if(!isLayer){
82-
constpageFiles=pagesContentPath.tryUse()
80+
constpagePaths: string[]=[]
81+
constpageFiles=pagesContentPath.tryUse()
8382

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-
elseif(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+
elseif(nuxtOptions.pages!==false&&nuxtOptions.pages?.enabled!==false){
89+
pagePaths.push(withSrcDir(`${nuxtOptions.dir?.pages||'pages'}/**/*${sfcExtensions}`))
9290
}
9391

9492
constcomponentPaths: string[]=[]
@@ -120,7 +118,7 @@ const createInternalContext = async (moduleOptions: ModuleOptions, nuxt = useNux
120118
nuxtOptions.dir?.layouts&&withSrcDir(`${nuxtOptions.dir.layouts}/**/*${sfcExtensions}`),
121119
nuxtOptions.dir?.plugins&&withSrcDir(`${nuxtOptions.dir.plugins}/**/*${defaultExtensions}`),
122120
...importDirs.map(d=>`${d}/**/*${defaultExtensions}`),
123-
...rootProjectFiles,
121+
...pagePaths,
124122

125123
withSrcDir(`{A,a}pp${sfcExtensions}`),
126124
withSrcDir(`{E,e}rror${sfcExtensions}`),

0 commit comments

Comments
 (0)