plugins/laravel-expert/skills/laravel-vite/SKILL.md
Complete Vite bundling for Laravel - assets, HMR, SSR, frameworks, optimization. Use when configuring frontend build pipeline.
npx skillsauth add fusengine/agents laravel-viteInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Before ANY implementation, use TeamCreate to spawn 3 agents:
After implementation, run fuse-ai-pilot:sniper for validation.
Vite is Laravel's default frontend build tool. It provides fast HMR in development and optimized builds for production.
| Feature | Purpose | |---------|---------| | HMR | Instant updates during development | | Bundling | Optimized production assets | | SSR | Server-side rendering support | | Frameworks | Vue, React, Svelte integration |
npm run build in CI/CDserver.host: '0.0.0.0'Using Tailwind CSS?
├── YES → v4? @tailwindcss/vite plugin
│ v3? PostCSS config
└── NO → Just laravel-vite-plugin
Using JavaScript framework?
├── Vue → @vitejs/plugin-vue
├── React → @vitejs/plugin-react
├── Svelte → @sveltejs/vite-plugin-svelte
└── None → Plain JS/CSS only
Need SEO/fast first paint?
├── YES → Using Inertia?
│ ├── YES → Inertia SSR
│ └── NO → Consider Inertia or Livewire
└── NO → Client-side only
| Topic | Reference | When to Consult | |-------|-----------|-----------------| | Setup | setup.md | Initial configuration | | Entry Points | entry-points.md | Multiple bundles | | Preprocessors | preprocessors.md | Sass, Less, PostCSS | | Assets | assets.md | Images, fonts, static | | Environment | environment.md | VITE_ variables | | Dev Server | dev-server.md | HMR, Docker, HTTPS | | Build | build-optimization.md | Chunks, minification | | SSR | ssr.md | Server-side rendering | | Inertia | inertia.md | SPA without API | | Frameworks | frameworks.md | Vue, React, Svelte | | Security | security.md | CSP nonce | | Deployment | deployment.md | Production, CDN |
| Template | When to Use | |----------|-------------| | ViteConfig.js.md | Standard setup | | ViteConfigAdvanced.js.md | Full optimization | | InertiaSetup.md | Inertia + Vue/React | | SSRSetup.md | SSR configuration |
// vite.config.js
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
],
});
<!DOCTYPE html>
<head>
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
| Command | Purpose |
|---------|---------|
| npm run dev | Start dev server |
| npm run build | Production build |
| npm run preview | Preview build |
refresh: true for Blade HMRVITE_ prefix for frontend env varslaravel/vite-plugin reste compatible Laravel 13 + Vite 6. Adaptations :
@vite() Blade fonctionne sans changement@vitejs/plugin-react v4+build.target: 'es2023' pour profiter de PHP 8.3 côté serveurdevelopment
Use when optimizing entity-based / semantic SEO 2026. Covers entity maps, Google Knowledge Graph resolution, salience scoring, passage-level ranking, about/sameAs/knowsAbout schema, Cloud Natural Language API validation.
development
Use when running SEO, GEO, schema, Core Web Vitals, sitemap, hreflang, E-E-A-T, AI Overviews, technical SEO, or structured data tasks. Covers full-site audits, single-page analysis, schema markup, content quality, AI search optimization, local SEO, sitemap/robots, internal linking, semantic clustering, and search experience.
development
Use when optimizing search experience (SXO). Covers intent matching, user personas, user stories, page-type analysis, dwell time, scroll depth, pogo-sticking prevention.
development
Use when optimizing local SEO. Covers Google Business Profile, NAP consistency, citations, reviews acquisition, Local Pack ranking, location pages, LocalBusiness schema.