Skip to content

Instantly share code, notes, and snippets.

@legecha
legecha / vite.config.js
Last active May 8, 2025 01:21
How to make Vite work with Laravel on remove development servers
/**
* This vite config allows you to run `npm run dev` in Laravel and access
* resources on a remote development server, including with hmr, in the
* same manner as if you were developing locally.
*
* All config is stored in your standard .env file and multiple users can
* have their own instance running by specifying a unique port.
*
* The certificates are required - use the same ones as used on your
* server to secure your development domains (i.e. letsencrypt).