Laravel Vite Plugin integrates Vite with Laravel, providing hot module replacement and asset bundling tailored for Laravel projects. Version 3.0.1 requires Vite ^8.0.0 and Node ^20.19.0 or >=22.12.0. It ships with TypeScript definitions and follows Laravel's convention for Vite configuration. Unlike generic Vite plugins, it handles Blade asset referencing, hot file management, and server URL resolution for Laravel's backend-first workflow. Major version bumps align with Vite major releases; v3 introduced Vite 8 support. The plugin is actively maintained by the Laravel core team.
npm install laravel-vite-pluginVerified import paths — ran on the pinned version, not inferred.
Minimal Vite configuration for Laravel app with Vue support, enabling HMR and asset refresh.
Upgrade Vite to ^8.0.0 and Node to a supported version (^20.19.0 or >=22.12.0).
Upgrade Vite to ^6.0.0 or ^7.0.0.
Use import statement instead of require.
Ensure the hotFile directory exists or upgrade to >=2.0.1.
Add CORS origins manually or upgrade to >=1.2.0.
Ensure Vite version matches plugin peer dependency (^8.0.0 for v3).
Install the package: npm install laravel-vite-plugin --save-dev. Use import instead of require.
Use import laravel from 'laravel-vite-plugin' (default export).