vite
Skill4 starsChanged 4 months agoMITView on GitHub
Bundle CSS and JS assets in Laravel with Vite — configure vite.config.js, load bundles with the @vite Blade directive, run hot module reload in development, build versioned assets for production, and import CSS/JS entry points. Use when the user needs to compile, bundle, or serve frontend CSS and JavaScript assets in a Laravel 10+ application; the user wants live reloading or hot module replacement of assets during local Laravel development; the user needs to build minified, versioned (cache-busted) frontend assets for a production Laravel deploy. Keywords: vite, assets, bundling, hot-module-reload, laravel.
36 other projects use a version of this.
Adopted by
Most recently taken up by
- GstMirabal/Token-Optimized-Agent-Pipelinetheir own version, first seen Nov 8, 2026
- Contentrain/studiotheir own version, first seen Nov 8, 2026
- ptonlix/OneSelftheir own version, first seen Nov 8, 2026
- antfu/skillstheir own version, first seen Nov 5, 2026
- onmax/nuxt-skillstheir own version, first seen Nov 1, 2026
- lirantal/slides-toxicskills-agent-skills-malwaretheir own version, first seen Oct 25, 2026
Used with
Projects with it also use antfu-design, nitro and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
wltn7810-dotcomSkillantfu-design
antfu-style design conventions, broadened. UnoCSS-first, class-based semantic tokens with dual light/dark for tooling and devtools UIs, plus design-read, anti-slop, and micro-interaction polish for landing pages and product surfaces. Use when building or refactoring any interface with UnoCSS.
Also in 3 projects that use this
SentrySkillnitro
Build and deploy universal JavaScript servers with Nitro v3. Use when working with nitro.config.ts, defineNitroConfig, defineHandler, defineConfig, server.ts entry, filesystem routing, route rules, useStorage, defineCachedHandler, useDatabase, definePlugin, runtime hooks, Vercel/Cloudflare deployment, or migrating from Nitro v2/nitropack.
Also in 4 projects that use this
xfstudioSkillnodejs-backend-patterns
Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices. Use when creating Node.js servers, REST APIs, GraphQL backends, or microservices architectures.
Also in 5 projects that use this
xenitV1Skillnodejs-best-practices
Node.js development principles and decision-making. Framework selection, async patterns, security, and architecture. Teaches thinking, not copying.
Also in 4 projects that use this
midudevSkilltailwind-css-patterns
Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.
Also in 3 projects that use this
xfstudioSkilltypescript-advanced-types
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.
Also in 5 projects that use this
Other versions36 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 36
- debpalash/OmniVoice-Studio★ 105ksame name
- debpalash/VoiceStudio★ 104ksame name
- antfu/skills★ 6.1ksame name
- onmax/nuxt-skills★ 724same name
- oyjt/uniapp-vue3-template★ 628same name
- victorgarciaesgi/regle★ 508same name
- JetBrains/skills★ 386same name
- Mindrally/skills★ 275same name
- magnus919/agent-skills★ 172same name
- uni-helper/skills★ 107same name
26 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository119 other files it gives its agents.
- strategy-bitrix-d7-incrementalSkill
- strategy-explicit-over-magicSkill
- strategy-framework-conventionsSkill
- strategy-legacy-safe-editsSkill
- strategy-minimal-diffSkill
- strategy-no-untested-refactorSkill
- strategy-preserve-public-apiSkill
- strategy-readonly-immutabilitySkill
- strategy-security-firstSkill
- strategy-test-drivenSkill
- openapiSkill
- paginationSkill
- rest-designSkill
- versioningSkill
- cqrsSkill
- dependency-inversionSkill
- hexagonalSkill
- repository-patternSkill
- service-layerSkill
- bitrixSkill
- findings-reportSkill
- laravelSkill
- performanceSkill
- phpSkill
- project-analysisSkill
- refactoringSkill
- roi-prioritizationSkill
- securitySkill
- stack-detectionSkill
- cache-layersSkill
- component-engineSkill
- d7-eventsSkill
- d7-loaderSkill
- d7-orm-queriesSkill
- iblock-elementsSkill
- kernel-main-moduleSkill
- localizationSkill
- controllersSkill
- ormSkill
- validationSkill
- controllersSkill
- query-builderSkill
- routingSkill
- autoload-psr4Skill
- dependency-managementSkill
- scriptsSkill
- connection-poolingSkill
- mysql-indexingSkill
- redisSkill
- transactionsSkill
- ci-github-actionsSkill
- deployment-strategiesSkill
- docker-phpSkill
- env-configSkill
- associationsSkill
- entities-mappingSkill
- orm-basicsSkill
- entity-apiSkill
- module-developmentSkill
- routing-controllersSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 31 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 64
Do not use this skill when the task is to maintain an existing webpack.mix.js Laravel Mix pipeline that cannot yet migrate.
- Distinctive: line 65
Do not use this skill for API-only or server-rendered work that ships no CSS or JavaScript bundle.
- Very specific: line 81
Run npm run dev while developing for hot module reload, and run npm run build in the deploy pipeline to produce the versioned production …
- Very specific: line 88
Import stylesheets from a JS entry (for example import '../css/app.css' in resources/js/app.js) so Vite processes them, or list the CSS …
- Distinctive: line 116
Not applicable — no I/O, auth, or untrusted input.
“Common” is measured: kept by at least 6 in 10 of the 31 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- generated: do not edit — source: knowledge/atoms/laravel/vite/ --><!-- schema: atomVersion=3 skillVersion=2 graphVersion=1 --><!-- compile: @php-skills/compiler v1.0.0 (deterministic build) -->Laravel Vite
When to use
- The user needs to compile, bundle, or serve frontend CSS and JavaScript assets in a Laravel 10+ application.
- The user wants live reloading or hot module replacement of assets during local Laravel development.
- The user needs to build minified, versioned (cache-busted) frontend assets for a production Laravel deploy.
When NOT to use
- Do not use this skill when the task is to maintain an existing webpack.mix.js Laravel Mix pipeline that cannot yet migrate; use the laravel/mix skill instead.
- Do not use this skill for API-only or server-rendered work that ships no CSS or JavaScript bundle.
Core guidance
- Run the dev server locally and build for production — Use
npm run devfor local work so Vite serves assets with hot module reload; runnpm run buildin CI or on deploy to emit hashed files plus a manifest. - Load bundles through the @vite Blade directive — Reference entry points with the
@vite([...])Blade directive rather than hardcoding<script>or<link>tags. Pass the exact entry paths declared invite.config.js, for example@vite(['resources/css/app.css', 'resources/js/app.js']).
Quick recipe
- In
vite.config.js, register thelaravel()plugin with aninputarray listingresources/css/app.cssandresources/js/app.jsand setrefresh: true. (verify:npm run buildemits files underpublic/buildwith amanifest.json) - In the Blade layout
<head>, add@vite(['resources/css/app.css', 'resources/js/app.js'])so both entry points are loaded through the directive. (verify: The rendered page includes the CSS and JS tags Vite generates) - Run
npm run devwhile developing for hot module reload, and runnpm run buildin the deploy pipeline to produce the versioned production bundle. (verify: Local edits hot-reload; a production deploy serves hashed files with no dev server)
Best practices
- List each CSS and JS entry point in the
laravel()plugininputarray insidevite.config.js; the @vite directive can only load paths declared there - Import stylesheets from a JS entry (for example
import '../css/app.css'inresources/js/app.js) so Vite processes them, or list the CSS file directly in the plugininputarray - Set
refresh: trueon thelaravel()plugin invite.config.jsso edits to Blade views and routes trigger a full-page reload through the Vite dev server
Anti-patterns
| Anti-pattern | Why it fails | Do instead |
| Committing built assets into version control | Built assets bloat the repo, cause constant merge conflicts on the manifest, and drift from source when someone forgets to rebuild. | Gitignore public/build and generate it in CI or on deploy with npm run build. |
| Running the Vite dev server in production | The dev server is unminified, unversioned, and binds to a local port, so it is slow, insecure, and unavailable to real users. | Serve the static output of npm run build and let the web server deliver the hashed files under public/build. |
| Hand-writing script and link tags for bundles | Manual tags cannot resolve the per-build manifest hash or switch to the dev server, so they break on rebuild and in development. | Replace manual tags with @vite([...]), letting the directive resolve dev-server and manifest URLs automatically. |
See references/anti-patterns.md.
Common mistakes
- Stale hot file makes production point at the dev server — A leftover
public/hotfile makes the @vite directive emit dev-server URLs in production, so assets fail to load. Fix: Deletepublic/hoton deploy (it is written bynpm run devand removed on shutdown) and add it to .gitignore. - Deploying without running the production build — Deploying without
npm run buildleaves no manifest, so the @vite directive throws a "Vite manifest not found" error. Fix: Addnpm ci && npm run buildto the deploy pipeline and commit or ship the generatedpublic/buildoutput. - Referencing public assets by literal build path — Hardcoding a hashed path like
/build/assets/app-4f3a.jsbreaks on the next build because the hash changes. Fix: Always resolve asset URLs through the @vite directive (orVite::asset()for static files) so the current manifest hash is used.
Version notes
- Vite is the default bundler from Laravel 9.19+ — Vite ships as the default frontend bundler in Laravel 9.19+ and is the only bundler scaffolded in Laravel 10 and 11.
Security
- Not applicable — no I/O, auth, or untrusted input.
Testing
- Activation and decision behavior are verified in
eval/scenarios/laravel/vite.yaml.
Additional resources
- references/anti-patterns.md
- references/core.md
- references/examples.md
- references/pitfalls.md
- references/recipes.md
- references/version-differences.md
Knowledge graph
Supersedes: laravel/mix
<!-- graph-fragment: graph/fragments/laravel/vite.yaml -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

