Show a QR code with the address in the terminal when using `--host`.
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
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
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
vite-plugin-qrcode has this exact feature.
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.
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.