From 83e19e8eb26b75e13b3c8a87a50ef7668d4f1b0f Mon Sep 17 00:00:00 2001 From: Burt <1020103647@qq.com> Date: Thu, 4 Jan 2024 13:37:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(pages):=20exclude=20=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=95=88=EF=BC=8C=E9=85=8D=E7=BD=AE=E5=9C=B0=E6=96=B9=E9=94=99?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E8=A6=81=E9=99=AA=E5=9C=A8vite.config.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.config.ts | 6 ------ src/pages.json | 5 ----- uni-pages.d.ts | 3 +-- vite.config.ts | 2 +- 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/pages.config.ts b/pages.config.ts index c19af24..f73172d 100644 --- a/pages.config.ts +++ b/pages.config.ts @@ -40,12 +40,6 @@ export default defineUniPages({ }, // 你也可以定义 pages 字段,它具有最高的优先级。 pages: [], - /** - * exclude page - * 排除的页面,相对于 dir 和 subPackages,通常把这些目录里面的components里面的文件排除掉 - * @default [] - */ - exclude: ['**/components/**/**.*'], /** * subPackages 扫描的目录,例如:src/pages-sub * @type SubPackage[] | undefined diff --git a/src/pages.json b/src/pages.json index 69bc08b..b12c80d 100644 --- a/src/pages.json +++ b/src/pages.json @@ -64,12 +64,7 @@ "backgroundColor": "#23c09c", "navigationStyle": "custom" } - }, - { - "path": "pages/index/components/demo", - "type": "page" } ], - "exclude": ["**/components/**/**.*"], "subPackages": [] } diff --git a/uni-pages.d.ts b/uni-pages.d.ts index 79b9205..6cfba54 100644 --- a/uni-pages.d.ts +++ b/uni-pages.d.ts @@ -7,8 +7,7 @@ interface NavigateToOptions { url: "pages/index/index" | "pages/demo/index" | "pages/my/index" | - "pages/throughout/index" | - "pages/index/components/demo"; + "pages/throughout/index"; } interface RedirectToOptions extends NavigateToOptions {} diff --git a/vite.config.ts b/vite.config.ts index 7887315..834291f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -45,7 +45,7 @@ export default ({ command, mode }) => { return defineConfig({ plugins: [ // UniPages() 需要在 Uni() 之前引入 - UniPages(), + UniPages({ exclude: ['**/components/**/**.*'] }), Uni(), UnoCSS(), process.env.UNI_PLATFORM === 'h5' && htmlPlugin(env.VITE_APP_TITLE),