Laravel Vite Plugin
Official Vite plugin for Laravel to handle asset bundling and HMR.
3. Used by agents' projects
Dependency in 172 public GitHub projects set up for AI coding agents that we scanned (2.7%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error
What Laravel Vite Plugin does
Laravel Vite Plugin does one narrow job, setting up Vite for a Laravel backend server, and its README is only a pointer to the Laravel docs; the one builder write-up uses it outside Laravel, in a WordPress theme, to get the hot reloading he could not get from plain Vite.
Laravel Vite Plugin popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How Laravel Vite Plugin is used
- Laravel Vite Plugin is a dependency in 172 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (3.5% of the 4,867 JavaScript/TypeScript ones), #5 of 185 in build tools and bundlers.
- Projects that use it most often also use Vite (100.0%), concurrently (87.2%), Tailwind CSS (97.7%).
- It is more common in projects set up for Junie (58.1%) than for GitHub Copilot (2.0%).
By coding agent
Often used with
Laravel Vite Plugin in practice
Strengths
The README describes a single purpose. The plugin configures Vite so it works with a Laravel backend server.
Marc Wieland writes that the plugin lets you do "everything like in Vite" and adds "goodies" for CORS, SSL and hot module reloading. He gives these as the reason he failed when setting things up with plain Vite and switched to the plugin. With his manual setup he had compilation working, but not hot reloading.
The same builder writes that "Herd automatically supports Vite within the Laravel Vite plugin". He says that once SSL is turned on for the project in Herd, "you don't get annoying warnings" from the browser about an insecure site.
The latest release handles null addresses on the dev server. It also stops the plugin from cleaning up the hot file when Vitest runs.
Watch out for
The repository README has no setup steps and no options. It points to the Laravel website for documentation.
In Laravel, a Blade directive injects the Vite scripts. In WordPress, the builder rebuilt that logic in PHP. His code checks for the dev server or reads <code>manifest.json</code> for the production files.
The builder had to set <code>APP_URL</code> in his env file to his home URL. He says this is what makes the dev server point at his actual homepage.
More about Laravel Vite Plugin
Packages around it
- vite: Build tool the plugin configures
- concurrently: Runs several commands at once
- tailwindcss: Utility-first CSS framework
- axios: HTTP client
- @inertiajs/react: Inertia adapter for React
- prettier: Code formatter
More in Build tools and bundlers
Alternatives
Laravel Vite Plugin This page
Get started
Install it.
npm install laravel-vite-pluginRules for your agent
## Laravel Vite Plugin
- Use the official docs at https://laravel.com/docs/vite. The GitHub README has no usage details.
- One builder's blog post, not the official docs, installs it as a dev dependency with `npm install laravel-vite-plugin --save-dev`. Check the official docs for the current install steps.
- Register it in `vite.config.js` with `import laravel from 'laravel-vite-plugin'` and list entry files in the `input` array of `laravel({ ... })`. `publicDirectory` can be set there too.
- In a Laravel app, Blade's Vite directive loads the assets. Outside Laravel there is no such directive, so the project has to write that loading code itself.
- One builder's WordPress setup, not the official docs: check for a `hot` file in the theme's assets folder (his `publicDirectory`) to detect the running dev server. If it is missing, read `build/manifest.json` and load the hashed files.
- Same WordPress setup: load `/@vite/client` and the entry script with `type="module"`. The author calls this "very important".
- Same WordPress setup: set `APP_URL` in the env file to the site's home URL before running `npm run dev`.