Nov 05 2024

Using Vite with laravel herd


Not sure if I was the only one that struggled to find an answer to this, but I'm posting it here for anyone who might also be unfamiliar with vite and didn't think to do this either. All you have to do is set the server.host in your vite.config.js:

1import { defineConfig } from 'vite';
2import laravel from 'laravel-vite-plugin';
3 
4export default defineConfig({
5    plugins: [
6        laravel({
7            input: [
8                'resources/css/app.css',
9                'resources/js/app.js'
10            ],
11            refresh: true,
12        }),
13    ],
14    server: {
15        host: "[your site URL]"
16    }
17 
18});