-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(other): print project information in console
- Loading branch information
Showing
4 changed files
with
95 additions
and
3 deletions.
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
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,23 @@ | ||
import type { Plugin } from 'vite'; | ||
import gradientString from 'gradient-string'; | ||
import boxen, { type Options as BoxenOptions } from 'boxen'; | ||
|
||
const welcomeMessage = gradientString('#646cff', 'magenta').multiline( | ||
`您好! 欢迎使用 react-soybean 开源项目\n我们为您精心准备了精美的保姆级文档\nhttps://react-soybean-docs.pages.dev/index-cn?theme=dark` | ||
); | ||
|
||
const boxenOptions: BoxenOptions = { | ||
padding: 0.5, | ||
borderColor: '#646cff', | ||
borderStyle: 'round' | ||
}; | ||
|
||
export function setupProjectInfo(): Plugin { | ||
return { | ||
name: 'vite:buildInfo', | ||
|
||
buildStart() { | ||
console.log(boxen(welcomeMessage, boxenOptions)); | ||
} | ||
}; | ||
} |
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.