antfu / vscode-vite

One step faster for Vite in VS Code ⚡️
https://marketplace.visualstudio.com/items?itemName=antfu.vite
452 stars 25 forks source link

Allow for custom flag settings #32

Open Woovie opened 1 year ago

Woovie commented 1 year ago

Clear and concise description of the problem

I have customized my dev command to be vercel dev to ensure my Serverless Functions for Vercel are usable within this extension. When the command runs, you can see this error:

130 % vercel dev --port=4000
Vercel CLI 30.0.0
WARN! `--port` is deprecated, please use `--listen` instead
> Running Dev Command “vite --port $PORT”

  VITE v4.3.9  ready in 145 ms

  ➜  Local:   http://localhost:4000/
  ➜  Network: use --host to expose
  ➜  press h to show help
> Ready! Available at http://localhost:4000
WARN! `--port` is deprecated, please use `--listen` instead

Suggested solution

Allow users to specify custom flag names or a flag override field would be the ideal solution.

Alternative

Have a field that allows users to input their own flags and ignore the default port field? Not sure.

Additional context

It looks like --port is hardcoded at the moment:

https://github.com/antfu/vscode-vite/blob/57f6c6b6978b635bd25ab511744a8b5219fcf2f1/src/start.ts#L38

Validations

Woovie commented 1 year ago

I think maybe having a dotfile configuration would also perhaps be nice so this can be a per-project setting.