amitmerchant1990 / amitmerchant-dot-com-comments

1 stars 0 forks source link

expose-local-vite-instance-to-the-network/ #69

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

Expose local Vite instance to the network — Amit Merchant — A blog on PHP, JavaScript, and more

When you have configured your web application development build using Vite, you might have set it up in your package.json like so.

https://www.amitmerchant.com/expose-local-vite-instance-to-the-network/

fpolli commented 1 year ago

Hi. I am using the --host cli parameter to start vite server. It correctly shows the network address. If I load the page (laravel-vite-inertia-svelte) from the server computer, the page serves fine. If I try to access the page from the LAN, all of the assets are "connection refused." All of the requests and asset filenames look correct. I cannot find a vite log or any reference on the web to where I would find it. Any ideas?

grantiago commented 1 year ago

Thanks. I appreciate the write-up. I had a faint memory of doing this before. You might post this on SO. The first thread searching 'serve npm over local network' If I just post the link they will swat me down. :smile: Nice looking Jekyll page as well. :thumbsup: