-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Open
Labels
p2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)
Description
Description
Currently, as per the vite types, server.open can only accept boolean | string
→
vite/packages/vite/src/node/http.ts
Line 37 in 26bcdc3
| open?: boolean | string |
Further more, the Vite docs say:
server.open
See the open package for more details.
When checking the Open docs, for best cross-platform support, they suggest to set the browser like so:
const open = require('open');
await open('https://google.com', {
app: {
name: open.apps.chrome
}
});Ref: https://github.com/sindresorhus/open#openapps
However, trying to use open.apps.chrome in Vite like so, gives a type error:
server: { open: open.apps.chrome }Suggested solution
We need to be able to set Chrome but make sure it works for both Windows and MacOS.
My suggestion is to allow readonly string[] which is returned by open.apps.chrome so that we can use this option in the Vite config.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)
Type
Projects
Status
Has plan
