-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
refactor: normalize scripts and commands naming #5207
Conversation
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 am good with these changes. But maybe let's have Evan aware of this first in today's meeting?
We decided to move forward with this change. I think we can do it in the next minor even if it doesn't affect core with a breaking change, and only create-vite. I'll update the docs to make it more clear that |
I'll merge this one and then send another PR with a new section for the CLI in the docs. We don't really have a CLI reference at this point so it is hard to see where to properly add this info. |
Description
See #5097 for context. That PR explored what would be needed to change
serve
bydev
everywhere, also in the internal API. As plugins are already usingconfig.command === 'serve'
, it is hard to justify such a breaking change for the ecosystem.Looks like SvelteKit, Astro and others are using
preview
as a script name without issues. Maybe this is only a problem when there is aview
script? (but that would be already in the hands of the user to arrange). So, this PR changes the current setup from:to:
pnpm run serve
->pnpm run preview
. This is only used internally and in templates, so we don't need to keep the old script around. We could add the script and log a message for a while but it may be overkill and add noise to the starter templates.dev
is introduced as an alias forserve
to run the dev server. Current users are used to seeingdev
as the script name, and this aligns Vite to other tools in the ecosystem.serve
isn't deprecated at this point, because the internal API still usescommand === 'serve'
. IMO it is best to keep both aliases for the cli.What is the purpose of this pull request?