-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(projects): add vite plugin @soybeanjs/router-page
- Loading branch information
1 parent
288d586
commit 40c1e13
Showing
6 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
!.env-config.ts | ||
components.d.ts | ||
router-page.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,5 +30,6 @@ stats.html | |
*.sw? | ||
|
||
/src/typings/components.d.ts | ||
/src/typings/router-page.d.ts | ||
package-lock.json | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.