From 6a344ff2c7069428bd98521603a69cd509ff6d4c Mon Sep 17 00:00:00 2001 From: Soybean Date: Tue, 8 Nov 2022 09:18:05 +0800 Subject: [PATCH] build(projects): update plugin config --- build/plugins/index.ts | 4 ++-- build/plugins/soybeanjs.ts | 18 ------------------ 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 build/plugins/soybeanjs.ts diff --git a/build/plugins/index.ts b/build/plugins/index.ts index 67de5b33..1b118010 100644 --- a/build/plugins/index.ts +++ b/build/plugins/index.ts @@ -4,12 +4,12 @@ import vueJsx from '@vitejs/plugin-vue-jsx'; import unocss from '@unocss/vite'; import { VitePWA } from 'vite-plugin-pwa'; import progress from 'vite-plugin-progress'; +import routerPage from '@soybeanjs/router-page'; import html from './html'; import unplugin from './unplugin'; import mock from './mock'; import visualizer from './visualizer'; import compress from './compress'; -import soybeanjs from './soybeanjs'; /** * vite插件 @@ -25,7 +25,7 @@ export function setupVitePlugins(viteEnv: ImportMetaEnv): (PluginOption | Plugin unocss(), mock, progress(), - soybeanjs() + routerPage() ]; if (viteEnv.VITE_VISUALIZER === 'Y') { diff --git a/build/plugins/soybeanjs.ts b/build/plugins/soybeanjs.ts deleted file mode 100644 index 3886db11..00000000 --- a/build/plugins/soybeanjs.ts +++ /dev/null @@ -1,18 +0,0 @@ -import routerPage from '@soybeanjs/router-page'; - -export default function createSoybeanjsPlugin() { - return routerPage({ - pagesFormatter: names => { - /** 系统的内置路由,该文件夹名称不作为RouteKey */ - const SYSTEM_VIEW = 'system-view'; - - const result = names - .filter(name => name !== SYSTEM_VIEW) - .map(name => { - return name.replace(`${SYSTEM_VIEW}_`, ''); - }); - - return result; - } - }); -}