-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
feat: show more info on server start #18808
base: main
Are you sure you want to change the base?
Conversation
info(` ${colors.green('➜')} ${colors.bold('Mode')}: ${mode}`) | ||
const envFiles = getLoadedEnvFileNamesForMode(mode, envDir) | ||
info( | ||
` ${colors.green('➜')} ${colors.bold('Env')}: ${envFiles.length ? envFiles.join(' ') : 'no env files loaded'}`, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sapphi-red says
I think it makes sense to show the mode. But for the loaded env files, I guess you can know which file is loaded if you know which mode it's running in.
Personally, it's user-friendly to show which .env
files are loaded in what order, especially for beginners and teams where both senior and junior are, even they are described in documentation.
Adding this feature doesn't seem to make Vite such slow, does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it'll affect the perf. I felt showing the env files is a bit too wordy. Although, that's probably just because I'm too familiar with Vite 😅 I think I'm fine if the files are listed in a single line. Even further, maybe it can be in the same line with Mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally would not print the env files. If someone is interested in knowing that (usually for debugging purposes), we could probably print it under vite:config
or vite:env
DEBUG flags if they're not already printed.
Description
Resolves #18719
Replaces #18721, whose target branch is v5
DevServer.printUrls
andPreviewServer.printUrls
.DevServer.printInfo
andPreviewServer.printInfo
.env
file names on server start