wip: suppoer vite2 -- hack xlsx

This commit is contained in:
vben
2021-01-10 10:17:30 +08:00
parent 47f72e7ead
commit daf2b1e095
6 changed files with 187 additions and 147 deletions

View File

@@ -12,10 +12,11 @@ const LayoutMap = new Map<LayoutMapKey, () => Promise<typeof import('*.vue')>>()
// 动态引入
function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) {
// TODO Because xlsx does not support vite2.0 temporarily. So filter the excel example first
// regexp: /^(?!.*\/demo\/excel).*\.(tsx?|vue)$/,
const dynamicViewsModules = importContext({
dir: '/@/views',
deep: true,
regexp: /^(?!.*\/demo\/excel).*\.(tsx?|vue)$/,
regexp: /\.(tsx?|vue)$/,
dynamicImport: true,
dynamicEnabled: 'autoImportRoute',
});