mirror of https://github.com/vuejs/vitepress
previously, cli.ts was injecting onAfterConfigResolve solely to print
the version banner. Now, build() itself will log the version after
resolving the config, unless the caller has supplied a different
onAfterConfigResolve.
BREAKING CHANGE: callers of vitepress' build() will now notice the
version banner gets printed. To disable that, pass a noop function:
```ts
build(root, {
onAfterConfigResolve() {},
})
```
pull/5347/head
parent
4f8703d61c
commit
3fbaf9c4d2
@ -0,0 +1,10 @@
|
||||
import c from 'picocolors'
|
||||
import { version as viteVersion, type Logger } from 'vite'
|
||||
import { version } from '../../../package.json'
|
||||
|
||||
export function logVersion(logger: Logger) {
|
||||
logger.info(
|
||||
`\n ${c.green(`${c.bold('vitepress')} ${version}`)} ${c.gray(`(using vite ${viteVersion})`)}\n`,
|
||||
{ clear: !logger.hasWarned }
|
||||
)
|
||||
}
|
||||
Loading…
Reference in new issue