From 5c83613bc42c418fca6e514a6f91e5b7032efdd8 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Sun, 26 Oct 2025 14:34:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(vite=E9=85=8D=E7=BD=AE):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0WotResolver=E7=BB=84=E4=BB=B6=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在vite配置中引入@uni-helper/vite-plugin-uni-components/resolvers的WotResolver,用于自动解析组件 --- vite.config.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 5b4908f..7ddd86c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,6 +2,7 @@ import path from 'node:path' import process from 'node:process' import Uni from '@uni-helper/plugin-uni' import Components from '@uni-helper/vite-plugin-uni-components' +import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers' // @see https://uni-helper.js.org/vite-plugin-uni-layouts import UniLayouts from '@uni-helper/vite-plugin-uni-layouts' // @see https://github.com/uni-helper/vite-plugin-uni-manifest @@ -138,6 +139,7 @@ export default defineConfig(({ command, mode }) => { ), syncManifestPlugin(), Components({ + resolvers: [WotResolver()], extensions: ['vue'], deep: true, // 是否递归扫描子目录, directoryAsNamespace: false, // 是否把目录名作为命名空间前缀,true 时组件名为 目录名+组件名,