Yesterday, the Laravel team https://twitter.com/taylorotwell/status/1541795873838989314 the official vite-plugin. From now on, Vite will be the standard build tool for Laravel. The main benefits are vastly improved build times and a more straightforward API.
export default defineConfig({ //... server: { https: true, host: 'localhost', }, }); And then, you need to go to https://localhost:3000 in your browser.
import fs from 'fs'; import laravel from 'laravel-vite-plugin' import {defineConfig} from 'vite' import {homedir} from 'os' import {resolve} from 'path' let host = 'freek.dev.test' export default defineConfig({ plugins: [ laravel([ 'resources/js/app.js', ]), ], server: detectServerConfig(host), }) function detectServerConfig(host) { let keyPath = resolve(homedir(), `.config/valet/Certificates/${host}.key`) let certificatePath = resolve(homedir(), `.config/valet/Certificates/${host}.crt`) if (!fs.existsSync(keyPath)) { return {}} if (!fs.existsSync(certificatePath)) { return {}} return { hmr: {host}, host, https: { key: fs.readFileSync(keyPath), cert: fs.readFileSync(certificatePath), }, }}