Repository navigation
Conversation
|
Hmm I suppose it took a value in case it needed it in the future, like for naming the profile file, just that it never done that. Do we want to consider possibly renaming the file then? Otherwise this change will cause a small breaking change. and if we decide later we want to accept a value, it'll cause another small breaking change. |
Good point. I implemented this in a new PR, #23042. BTW, it seems this behavior was introduced about five years ago, when Evan first implemented it: e312645 |
|
Closing in favor of #23042 |
fixes #23032
bin/vite.jsstrips--profilefromprocess.argvbefore cac parses it, but it also removed the next non-flag token, as if the flag took a value.--profilenever takes a value: the profiler is started unconditionally and no code reads a value for it. So the extra splice only swallowed real positionals. For example,vite --profile my-appsilently started the dev server in the current directory instead ofmy-app, andvite --profile buildstarted a dev server instead of building. Writing the flag after the positional was unaffected, which is why this went unnoticed.No test is included:
bin/vite.jshas no existing test coverage and the change only deletes dead logic. Verified manually thatvite build --profile <root>now builds<root>(the CPU profile is still written) and that the flag-last form behaves the same as before.