Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packages/core/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,18 @@ export class PageContext {
}

async mergePageMetaData() {
const pageMetaData = await this.parsePages(this.pages, 'main', this.pagesGlobConfig?.pages)
const subPages = [...this.subPages.keys()].map(v => v.replace('src/', ''))

// 过滤掉属于子包的页面,创建新的 pages Map
const filteredPages = new Map<string, Page>()
for (const [path, page] of this.pages) {
if (subPages.some(v => page.uri.startsWith(v))) {
continue
}
filteredPages.set(path, page)
}

const pageMetaData = await this.parsePages(filteredPages, 'main', this.pagesGlobConfig?.pages)

this.pageMetaData = pageMetaData
debug.pages(this.pageMetaData)
Expand Down
5 changes: 5 additions & 0 deletions packages/playground/src/pages/pages-internal-sub/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div>
this is pages-internal-sub
</div>
</template>
3 changes: 2 additions & 1 deletion packages/playground/src/uni-pages.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ type _LocationUrl =
"/pages/define-page/yaml" |
"/pages-sub/index" |
"/pages-sub/about/index" |
"/pages-sub/about/your";
"/pages-sub/about/your" |
"/pages/pages-internal-sub/index";

interface NavigateToOptions {
url: _LocationUrl;
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineConfig({
dts: 'src/uni-pages.d.ts',
homePage: 'pages/index',
debug: true,
subPackages: ['src/pages-sub', 'src/pages-sub2'],
subPackages: ['src/pages-sub', 'src/pages-sub2', 'src/pages/pages-internal-sub'],
// configSource: [
// {
// files: 'vite.config',
Expand Down
Loading