Vite dev: automatically open app in the browser

When running the vite dev server (commands vite, vite dev, and vite server), it's possible to specify the option --open so that the app opens automatically in the browser.

BROWSER and BROWSER_ARGS can also be used to pass additional settings, either as environment variables or as process.env arguments.

For example, in my case I want to open Firefox Developer Edition, so in package.json I use:

"dev": "BROWSER='/Applications/Firefox Developer Edition.app' vite --open"