Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite.clearScreen: false option is ignorred #4468

Closed
4 tasks done
maxpatiiuk opened this issue Jan 6, 2025 · 1 comment
Closed
4 tasks done

vite.clearScreen: false option is ignorred #4468

maxpatiiuk opened this issue Jan 6, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@maxpatiiuk
Copy link

Describe the bug

VitePress ignores the vite.clearScreen: false option - running vitepress build will clear the screen regardless.

This is causing issues in our turbo build monorepo - when building several packages at once, VitePress's clear screen clears the log output for packages that were built before it.

Reproduction

https://stackblitz.com/edit/vite-dtu41vnr?file=package.json

  1. Install dependencies
  2. Run npx vitepress build docs
  3. See that screen is cleared, despite vite.clearScreen:false in docs/.vitepress/config.ts

Expected behavior

Screen should not be cleared if vite.clearScreen:false is set

System Info

System:
    OS: macOS 15.2
    CPU: (10) arm64 Apple M1 Pro
    Memory: 78.41 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.12.0 - ~/.local/state/fnm_multishells/64248_1736184870871/bin/node
    Yarn: 1.22.19 - ~/.local/state/fnm_multishells/64248_1736184870871/bin/yarn
    npm: 10.9.0 - ~/.local/state/fnm_multishells/64248_1736184870871/bin/npm
  Browsers:
    Chrome: 131.0.6778.205
    Safari: 18.2
  npmPackages:
    vitepress: 1.5.0 => 1.5.0

Additional context

No response

Validations

@maxpatiiuk maxpatiiuk added the bug: pending triage Maybe a bug, waiting for confirmation label Jan 6, 2025
@maxpatiiuk
Copy link
Author

The bug seems to be here, where a logger is created with default options, rather than options from the config:

const logVersion = (logger = createLogger()) => {
logger.info(`\n ${c.green(`${c.bold('vitepress')} v${version}`)}\n`, {

Would it be possible to delay logging to the screen until config is resolved? (I assume this is what Vite does since it does not exhibit this problem)

@brc-dd brc-dd added bug Something isn't working and removed bug: pending triage Maybe a bug, waiting for confirmation labels Jan 6, 2025
@brc-dd brc-dd closed this as completed in 8ea776a Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants