Conversation
|
|
|
It's really a shame we can't call this |
Yes, I couldn't agree more.
👍 Done.
I think so too. How about we already start showing a warning in the next patch release? |
|
I noticed that this change is a breaking change as it requires users to pass an additional argument to |
|
We discussed about this in the meeting today. To minimize the changes, and since the main usecase is to only differentiate dev and preview, we think passing a This would make it work similar to the |
|
Neat, good idea. I'll try to update the PR later today. |
|
Neat. No need for credits. |
Description
This is solving a long standing problem: there isn't a reliable way to distinguish between
devandpreview(sinceconfig.command === 'serve'for both$ vite devand$ vite preview).There are workarounds but none of them are reliable. (E.g. checking whether
configureServer()/configurePreviewServer()is called doesn't work in certain situations.)What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).Ideally, include relevant tests that fail without this PR but pass with it.N/A.