laravel-mix-webpack
Skill4 starsChanged 5 months agoMITView on GitHub
Laravel Mix (Webpack wrapper) configuration for React SPAs. Babel setup, SASS compilation, asset versioning, hot module replacement. Use for build configuration, asset pipeline issues, or migration to Vite.
In this repository101 other files it gives its agents.
- ai-video-understandingSkill
- apple-foundation-modelsSkill
- arch-dddSkill
- arch-decision-recordsSkill
- arch-diagramsSkill
- arch-eventsSkill
- arch-mvp-roadmapSkill
- arch-python-modernSkill
- aws-app-runnerSkill
- aws-cicd-patternsSkill
- aws-security-hardeningSkill
- azure-functions-python-v2Skill
- azure-identity-m2m-authSkill
- azure-service-bus-messagingSkill
- azure-workflow-execution-modelsSkill
- caddy-tls-proxySkill
- compliance-frameworksSkill
- design-system-workflowSkill
- dev-debugging-strategiesSkill
- dev-standardsSkill
- docker-python-poetrySkill
- docker-pythonSkill
- fastapi-patternsSkill
- ffmpeg-laravel-videoSkill
- formik-yup-react-nativeSkill
- frontend-accessibilitySkill
- frontend-angular-aiSkill
- frontend-angularSkill
- frontend-angular-toolingSkill
- frontend-design-systemsSkill
- frontend-material-chatSkill
- frontend-material-design-3Skill
- frontend-svelteSkill
- gcp-cicd-patternsSkill
- gcp-cloud-runSkill
- gcp-cloudsql-infrastructureSkill
- gcp-finopsSkill
- gcp-observabilitySkill
- gcp-security-hardeningSkill
- github-actions-cicdSkill
- healthkit-biofeedbackSkill
- infra-terraformSkill
- ios-app-qualitySkill
- ios-audio-hapticsSkill
- jest-nestjs-testingSkill
- langchain-azure-openai-patternsSkill
- laravel-auth-hardeningSkill
- laravel-ci-mysqlSkill
- laravel-modern-patternsSkill
- laravel-pint-patternsSkill
- laravel-s3-storageSkill
- laravel-sail-dockerSkill
- mobile-app-deploymentSkill
- mobile-e2e-testingSkill
- mobile-offline-syncSkill
- mobile-push-notificationsSkill
- mobile-video-uploadSkill
- mongodb-asyncmongoclient-patternsSkill
- mongodb-atlas-patternsSkill
- nestjs-patternsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 48
Use mix('js/app.js') helper in Blade templates for automatic path resolution.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Laravel Mix Asset Compilation
Webpack wrapper for Laravel applications providing fluent API for React compilation, SASS preprocessing, and asset management. Laravel 8-10 standard (Laravel 11+ uses Vite).
When to Use
- Configuring Laravel Mix for React SPAs
- Setting up hot module replacement (HMR)
- Asset versioning and cache busting
- SASS/CSS compilation
- Code splitting and vendor extraction
- Troubleshooting Mix build issues
- Planning migration from Mix to Vite
Quick Setup Pattern
mix.react('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.extract(['react', 'react-dom'])
.version();Common Mix Methods
| Method | Purpose | Example |
.react() | Compile JSX with Babel | mix.react('src/app.js', 'public/js') |
.sass() | Compile SASS/SCSS | mix.sass('src/app.scss', 'public/css') |
.version() | Asset versioning | Auto-generates mix-manifest.json |
.extract() | Vendor code splitting | mix.extract(['react', 'react-dom']) |
.sourceMaps() | Enable source maps | For development only |
Hot Module Replacement
npx mix watch --hotUse mix('js/app.js') helper in Blade templates for automatic path resolution.
Production Build
NODE_ENV=production npx mix --productionMigration to Vite
Laravel 11+ uses Vite by default. Key changes: rename MIX_* → VITE_* env vars, require() → import, update Blade mix() → @vite(). Performance: 10-100x faster builds.
See examples.md for step-by-step migration guide.
Anti-Patterns
| Anti-Pattern | Pattern |
| JSX not compiling | Use mix.react() (used .js() instead of .react()) |
| HMR not working | Use npx mix watch --hot + mix('js/app.js') helper (missing .hot flag or wrong script source) |
| Cache not busting | Add mix.version() (missing .version()) |
| Script load order errors | Load manifest → vendor → app (incorrect .extract() ordering) |
| Large bundle size | Add .extract(['react', 'react-dom']) (no vendor extraction) |
See reference.md for custom Babel config, HMR configuration, environment variable handling. See examples.md for complete webpack.mix.js configs, Vite migration step-by-step.
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.

