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), }, }}
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners