vite icon indicating copy to clipboard operation
vite copied to clipboard

Show a QR code with the address in the terminal when using `--host`.

Open Artmann opened this issue 1 year ago • 3 comments

Description

As a developer building websites for a myriad of devices, I want to be able to open the local version of my site without having to type IP addresses and ports.

Suggested solution

Print a QR code when using the --host option.

Alternative

No response

Additional context

No response

Validations

Artmann avatar Aug 22 '24 18:08 Artmann

Recently I noticed Chrome has "Create QR Code for this page" https://support.google.com/chrome/answer/10051760?hl=en&co=GENIE.Platform%3DDesktop#zippy=%2Cshare-pages-with-a-qr-code and I'm usually satisfied with this. Does your browser have something similar? or is this setup still cumbersome (compared to having it on your terminal)?

Example

image

hi-ogawa avatar Aug 22 '24 23:08 hi-ogawa

vite-plugin-qrcode has this exact feature.

sapphi-red avatar Aug 23 '24 02:08 sapphi-red

I really like this feature, but given that it can be achieved in user land it may be a good idea to keep things as is. Frameworks and users that would like the feature can add the plugin (Nuxt already does this by default for example). I think what we need is better visibility for these kind of plugins.

patak-dev avatar Aug 23 '24 06:08 patak-dev

It would be kinda nice to have this builtin I think, but it's tricky to always show by default because qrcode rendering don't always render well on all terminals. It's also jarring to show all qrcodes if you have multiple external urls (which vite-plugin-qrcode had to introduce an option for), and I'm not really sure where or we'd want to add a new option for it.

And given the low download count of vite-plugin-qrcode, maybe this isn't worth it for now.

bluwy avatar Sep 01 '24 14:09 bluwy