build(projects): update plugin config
This commit is contained in:
parent
cc00c8f03a
commit
6a344ff2c7
@ -4,12 +4,12 @@ import vueJsx from '@vitejs/plugin-vue-jsx';
|
|||||||
import unocss from '@unocss/vite';
|
import unocss from '@unocss/vite';
|
||||||
import { VitePWA } from 'vite-plugin-pwa';
|
import { VitePWA } from 'vite-plugin-pwa';
|
||||||
import progress from 'vite-plugin-progress';
|
import progress from 'vite-plugin-progress';
|
||||||
|
import routerPage from '@soybeanjs/router-page';
|
||||||
import html from './html';
|
import html from './html';
|
||||||
import unplugin from './unplugin';
|
import unplugin from './unplugin';
|
||||||
import mock from './mock';
|
import mock from './mock';
|
||||||
import visualizer from './visualizer';
|
import visualizer from './visualizer';
|
||||||
import compress from './compress';
|
import compress from './compress';
|
||||||
import soybeanjs from './soybeanjs';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vite插件
|
* vite插件
|
||||||
@ -25,7 +25,7 @@ export function setupVitePlugins(viteEnv: ImportMetaEnv): (PluginOption | Plugin
|
|||||||
unocss(),
|
unocss(),
|
||||||
mock,
|
mock,
|
||||||
progress(),
|
progress(),
|
||||||
soybeanjs()
|
routerPage()
|
||||||
];
|
];
|
||||||
|
|
||||||
if (viteEnv.VITE_VISUALIZER === 'Y') {
|
if (viteEnv.VITE_VISUALIZER === 'Y') {
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user