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é serveurtesting
Copy self-audit and ban-lists — filler verbs/hype adjectives, slop placeholder names, fake-precise numbers, Title Case headlines, humor in error copy ('Oops!'), em-dash crutch, one copy register per page.
development
Logged-in web apps — dashboards, auth flows, settings, onboarding, data tables, command palettes, modals, toasts. Register `product`: density and glance-speed over marketing polish, no hero/CTA-tricks, every data surface covers empty/loading/error explicitly, tables and dataviz follow preattentive-processing rules.
development
Marketing sites, landing pages, campaign pages — register `brand` (design IS the product). Structure comes from the register's POV + a macrostructure pick, never from copying an inspiration site's section flow. Hero discipline, deviated section order, asymmetric grids, and a silhouette lookalike-test gate before ship.
development
Token-strategy core — OKLCH color rules, neutral tinting, accent-commitment levels, type scale, 8pt spacing grid, touch targets, and the canonical output format of design-system.md (the file the harness gates on). This is routing step 1 of design-method/SKILL.md — read it before design-web/design-webapp/design-ios/design-android, before picking or auditing a single color/type/spacing value.