question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to prevent Vite clearScreen on start-up

See original GitHub issue

Environment

Nuxt CLI v3.0.0-27307420.6a25d3e 22:48:45 RootDir: /srv/codelaunch 22:48:46 Nuxt project info: 22:48:46


  • Operating System: Linux
  • Node Version: v14.17.6
  • Nuxt Version: 3.0.0-27307420.6a25d3e
  • Package Manager: unknown
  • Bundler: Vite
  • User Config: srcDir, server, vite
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Run npm run dev

Describe the bug

Vite has a clearScreen CLI option which defaults to true.

In an attached docker-compose environment, it’s quite annoying to have Vite clear the screen on container start-up, if you’re looking for logs from other services, or initial container logs before vite starts, etc.

Nuxt should be able to proxy the --clearScreen false CLI option to vite. I suppose something like nuxi dev --clearScreen false ?

Additional context

https://vitejs.dev/config/#clearscreen

Logs

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
danielroecommented, Feb 23, 2022

I’m putting in a PR to fix the nuxi dev --help issue, as you’re quite right - the original requested behaviour does now work.

Please feel free to open a new issue about the ANSI escape sequences, though 🙏 I see you’ve done so!

2reactions
OJFordcommented, Feb 23, 2022

@peteromano nuxi dev --no-clear works for me.

Thanks for mentioning it though, nuxi dev --help doesn’t. (And does clear the screen itself, for help… I know some people like it for continuous stuff like webservers, but that’s surely excessive to anyone.)

Now just to find why it messes up ANSI escape sequences somehow on exit.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Vite
Configuring Vite #. When running vite from the command line, Vite will automatically try to resolve a config file named vite.config.js inside project...
Read more >
Shared Options | Vite
Set to false to prevent Vite from clearing the terminal screen when logging certain messages. Via command line, use --clearScreen false . envDir...
Read more >
Command Line Interface - Vite
Options # ; --clearScreen, Allow/disable clear screen when logging ( boolean ) ; -d, --debug [feat], Show debug logs ( string | boolean...
Read more >
Command Line Interface | Vite (main branch)
Options # ; --clearScreen, Allow/disable clear screen when logging ( boolean ) ; -d, --debug [feat], Show debug logs ( string | boolean...
Read more >
Build Options - Vite
By default, Vite will empty the outDir on build if it is inside project root. It will emit a warning if outDir is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found