This repository has been archived on 2026-04-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
vue-ts-example-2025/vite-plugins/01.vite-plugin-vue-meta-layouts.ts
T
严浩 9e050306bb
CI/CD Pipeline / playwright (push) Successful in 3m3s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m6s
feat: refactor Vite plugin loading mechanism and improve plugin management
2025-12-12 00:09:53 +08:00

21 lines
906 B
TypeScript

import MetaLayouts from 'vite-plugin-vue-meta-layouts';
import type { LoadPluginFunction } from './_loadPlugins';
export const loadPlugin: LoadPluginFunction = (_pluginLoadOptions) => {
return [
// https://github.com/dishait/vite-plugin-vue-meta-layouts
MetaLayouts({
target: 'src/layouts',
excludes: ['**/!(the-)*.vue'], // 排除非 the- 开头的文件。
metaName: 'layout',
// defaultLayout: 'sakai-vue/AppLayout',
// defaultLayout: 'naive-ui/AppLayout',
defaultLayout: 'base-layout/the-base-layout',
// !⬇️: 当设置为 `sync` 时,注意`import 'virtual:uno.css'`的顺序问题。
// importMode: 'sync', // 默认为自动处理,SSG 时为 sync,非 SSG 时为 async
skipTopLevelRouteLayout: true, // 打开修复 https://github.com/JohnCampionJr/vite-plugin-vue-layouts/issues/134,默认为 false 关闭
}),
];
};