chore: 启动项目时,控制台增加应用信息打印

This commit is contained in:
2024-05-11 22:41:49 +08:00
parent 1421412d67
commit 52e7682a47
4 changed files with 115 additions and 3 deletions

View File

@@ -0,0 +1,25 @@
import boxen from 'boxen'
import picocolors from 'picocolors'
import type { Plugin } from 'vite'
export default function appInfo(): Plugin {
return {
name: 'appInfo',
apply: 'serve',
async buildStart() {
const { bold, green, cyan, bgGreen, underline } = picocolors
// eslint-disable-next-line no-console
console.log(
boxen(
`${bold(green(`${bgGreen('ContiNew Admin v3.1.0-SNAPSHOT')}`))}\n${cyan('在线文档:')}${underline('https://continew.top')}\n${cyan('持续迭代优化的前后端分离中后台管理系统框架。')}`,
{
padding: 1,
margin: 1,
borderStyle: 'double',
textAlignment: 'center'
}
)
)
}
}
}