Skip to content

feat: show mode on server start and add env debugger #18808

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

Merged
merged 5 commits into from
Feb 20, 2025

Conversation

nozomuikuta
Copy link
Contributor

Description

Resolves #18719
Replaces #18721, whose target branch is v5

  • Deprecate DevServer.printUrls and PreviewServer.printUrls.
  • Add DevServer.printInfo and PreviewServer.printInfo
  • Make the new methods print mode and loaded .env file names on server start

@bluwy
Copy link
Member

bluwy commented Nov 28, 2024

For displaying mode, maybe it could look something like this?

image

(Using bgGreen and bold). I think we should only show the mode if it's changed (not "development") as proposed in the issue, otherwise it feels like unnecessary information to me.

I also think we should prevent renaming printUrls to printInfo and breaking it if possible.

@@ -69,6 +78,8 @@ export function loadEnv(
}
}

debug?.(`using resolved env: %O`, env)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we show process.env values (internal values) too? What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this current log is fine for now 👍

@nozomuikuta nozomuikuta changed the title feat: show more info on server start feat: show mode on server start and add env debugger Jan 3, 2025
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current implementation looks good to me 👍

@patak-dev patak-dev added this to the 6.2 milestone Feb 10, 2025
@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Feb 12, 2025
@sapphi-red sapphi-red merged commit c575b82 into vitejs:main Feb 20, 2025
17 checks passed
moonlitusun pushed a commit to moonlitusun/vite that referenced this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vite dev server screen additional infos (mode, loaded env)
4 participants