mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-25 22:30:19 +08:00
build(projects): add vite plugin @soybeanjs/router-page
This commit is contained in:
18
build/plugins/soybeanjs.ts
Normal file
18
build/plugins/soybeanjs.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user