skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
fusengine/claude-plugins62 installs

laravel-vite

Complete Vite bundling for Laravel - assets, HMR, SSR, frameworks, optimization. Use when configuring frontend build pipeline.

How do I install this agent skill?

npx skills add https://github.com/fusengine/claude-plugins --skill laravel-vite
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    The skill provides a comprehensive guide for integrating Vite with Laravel, following industry best practices. The primary security consideration is the potential for indirect prompt injection, as the agent is directed to analyze existing codebase configuration files which could contain untrusted instructions.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

<objective> Covers Vite as Laravel's frontend build tool: initial setup and the laravel-vite-plugin, multiple entry points, CSS preprocessors (Sass/Less/PostCSS), asset handling, VITE_-prefixed environment variables, the dev server and HMR (including Docker configuration), build optimization (chunking, minification), server-side rendering, Inertia integration, JS framework plugins (Vue/React/Svelte), CSP nonce security, and production deployment. </objective>

Laravel Vite

Agent Workflow (MANDATORY)

Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:

  1. fuse-ai-pilot:explore-codebase - Check existing vite.config.js, package.json
  2. fuse-ai-pilot:research-expert - Verify latest Vite docs via Context7
  3. mcp__context7__query-docs - Query specific patterns (SSR, Inertia)

After implementation, run fuse-ai-pilot:sniper for validation.


Overview

Vite is Laravel's default frontend build tool. It provides fast HMR in development and optimized builds for production.

FeaturePurpose
HMRInstant updates during development
BundlingOptimized production assets
SSRServer-side rendering support
FrameworksVue, React, Svelte integration

Critical Rules

  1. Always use laravel-vite-plugin - Never raw Vite config
  2. VITE_ prefix for env vars - Only exposed to frontend
  3. Use @vite directive - Not manual script tags
  4. Build before deploy - npm run build in CI/CD
  5. Configure HMR for Docker - Set server.host: '0.0.0.0'

Decision Guide

Stack Selection

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

SSR Decision

Need SEO/fast first paint?
├── YES → Using Inertia?
│   ├── YES → Inertia SSR
│   └── NO → Consider Inertia or Livewire
└── NO → Client-side only

Reference Guide

Concepts (WHY & Architecture)

TopicReferenceWhen to Consult
Setupsetup.mdInitial configuration
Entry Pointsentry-points.mdMultiple bundles
Preprocessorspreprocessors.mdSass, Less, PostCSS
Assetsassets.mdImages, fonts, static
Environmentenvironment.mdVITE_ variables
Dev Serverdev-server.mdHMR, Docker, HTTPS
Buildbuild-optimization.mdChunks, minification
SSRssr.mdServer-side rendering
Inertiainertia.mdSPA without API
Frameworksframeworks.mdVue, React, Svelte
Securitysecurity.mdCSP nonce
Deploymentdeployment.mdProduction, CDN

Templates (Complete Code)

TemplateWhen to Use
ViteConfig.js.mdStandard setup
ViteConfigAdvanced.js.mdFull optimization
InertiaSetup.mdInertia + Vue/React
SSRSetup.mdSSR configuration

Quick Reference

Basic Setup

// 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,
        }),
    ],
});

Blade Directive

<!DOCTYPE html>
<head>
    @vite(['resources/css/app.css', 'resources/js/app.js'])
</head>

Commands

CommandPurpose
npm run devStart dev server
npm run buildProduction build
npm run previewPreview build

Best Practices

DO

  • Use refresh: true for Blade HMR
  • Configure aliases for clean imports
  • Split vendors into separate chunks
  • Use VITE_ prefix for frontend env vars
  • Test Docker/Sail config locally

DON'T

  • Expose sensitive data via VITE_ vars
  • Forget to build before deploying
  • Use absolute paths for assets
  • Skip source maps in staging
  • Ignore chunk size warnings

Laravel 13 Notes

The Laravel 13 skeleton ships laravel-vite-plugin ^3.1 (current 3.2, peer vite ^8) + Vite 8 + @tailwindcss/vite ^4. Adjustments:

  • The @vite() Blade helper works unchanged
  • For Inertia 3 + React 19: use @vitejs/plugin-react (current 6.x)
  • Self-hosted fonts (13.7+): the plugin's fonts option (import { google, bunny, fontsource, local } from 'laravel-vite-plugin/fonts') + the @fonts Blade directive
  • Vite::devServerUrl() (13.31+) to get the dev server URL
  • HMR over WebSocket: Reverb and Vite can coexist on separate ports in dev
  • build.target is a browser (JS) target, independent of the server's PHP version

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/fusengine/claude-plugins/laravel-vite">View laravel-vite on skillZs</a>