fix: 排除前端测试文件的生产打包
This commit is contained in:
parent
a54c4d269b
commit
096f96143a
@ -16,7 +16,7 @@ const forbiddenComponent = () => import('#/views/_core/fallback/forbidden.vue');
|
|||||||
|
|
||||||
async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
||||||
const pageMap: ComponentRecordType = {
|
const pageMap: ComponentRecordType = {
|
||||||
...import.meta.glob('../views/**/*.tsx'),
|
...import.meta.glob(['../views/**/*.tsx', '!../views/**/*.spec.tsx']),
|
||||||
...import.meta.glob('../views/**/*.vue'),
|
...import.meta.glob('../views/**/*.vue'),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -4,9 +4,12 @@ import { mergeRouteModules, traverseTreeValues } from '@vben/utils';
|
|||||||
|
|
||||||
import { coreRoutes, fallbackNotFoundRoute } from './core';
|
import { coreRoutes, fallbackNotFoundRoute } from './core';
|
||||||
|
|
||||||
const dynamicRouteFiles = import.meta.glob('./modules/**/*.ts', {
|
const dynamicRouteFiles = import.meta.glob(
|
||||||
eager: true,
|
['./modules/**/*.ts', '!./modules/**/*.spec.ts'],
|
||||||
});
|
{
|
||||||
|
eager: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
// 有需要可以自行打开注释,并创建文件夹
|
// 有需要可以自行打开注释,并创建文件夹
|
||||||
// const externalRouteFiles = import.meta.glob('./external/**/*.ts', { eager: true });
|
// const externalRouteFiles = import.meta.glob('./external/**/*.ts', { eager: true });
|
||||||
@ -30,7 +33,7 @@ const coreRouteNames = traverseTreeValues(coreRoutes, (route) => route.name);
|
|||||||
const accessRoutes = [...dynamicRoutes, ...staticRoutes];
|
const accessRoutes = [...dynamicRoutes, ...staticRoutes];
|
||||||
|
|
||||||
const componentKeys: string[] = Object.keys({
|
const componentKeys: string[] = Object.keys({
|
||||||
...import.meta.glob('../../views/**/*.tsx'),
|
...import.meta.glob(['../../views/**/*.tsx', '!../../views/**/*.spec.tsx']),
|
||||||
...import.meta.glob('../../views/**/*.vue'),
|
...import.meta.glob('../../views/**/*.vue'),
|
||||||
})
|
})
|
||||||
.filter((item) => !item.includes('/modules/'))
|
.filter((item) => !item.includes('/modules/'))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user