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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners