First you need to ensure that your device is in same network
inpackage.json
file in your app, add this command
"host": "vite --host"
or use your own name, im usinghost
for command name. you can change the setting insidevite.config.js
too with this setting
server: { host: true }
vite will automatically use your ip as a server ip, then run the command withnpm run host
, and finally you can access your app in external device, just access it with{your ip}:{your app port}
eg:192.168.10.1:3000
.
Thanks for this githubissue
if you have another method feel free to discuss, thanks for reading
Top comments(0)
Subscribe
For further actions, you may consider blocking this person and/orreporting abuse