UNPKG

@uni-ku/root

Version:

借助 Vite 模拟出虚拟的全局组件,解决 Uniapp 无法使用全局共享组件问题

29 lines 641 B
import { Plugin } from "vite"; //#region src/index.d.ts interface UniKuRootOptions { /** * 是否启用虚拟节点 * @default false */ enabledVirtualHost?: boolean; /** * 是否启用全局ref * @default false */ enabledGlobalRef?: boolean; /** * 根文件名,注意不要携带 .vue * @default 'App.ku' */ rootFileName?: string; /** * 需要排除根组件的页面,支持 glob 匹配 * @example * ``` * ['pages/some.vue', 'pages/exclude/*.vue'] * ``` */ excludePages?: string | string[]; } declare function UniKuRoot(options?: UniKuRootOptions): Plugin; export = UniKuRoot;