agentleFS
AnyOrgNameAnyOrgName/php-skills/skills/laravel/mix/SKILL.md

mix

Skill4 starsChanged 5 months agoMITView on GitHub

Maintain legacy Laravel Mix asset pipelines (webpack.mix.js) — kept only for existing configs. New Laravel apps use Vite; prefer laravel/vite for any new or migrating frontend build. Use when the user must maintain or debug an existing webpack.mix.js Laravel Mix asset pipeline that has not been migrated to Vite; the user needs to fix or explain the `mix()` Blade helper and the mix-manifest.json it reads in a legacy project; the user needs to edit webpack.mix.js chained calls such as mix.js, mix.sass, or mix.version in a legacy build. Keywords: mix, webpack, assets, legacy, laravel.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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
  1. Distinctive:

    Do not use this skill to design the target Vite setup when migrating away from Mix.

    line 70
  2. Distinctive:

    Do not use this skill for a new Laravel app or a fresh asset pipeline.

    line 71
  3. Very specific:

    Run npm run dev for an unminified build while developing and npm run prod for a minified, versioned build on deploy.

    line 89
  4. Distinctive:

    Not applicable — no I/O, auth, or untrusted input.

    line 103

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- generated: do not edit — source: knowledge/atoms/laravel/mix/ --><!-- schema: atomVersion=3 skillVersion=2 graphVersion=1 --><!-- compile: @php-skills/compiler v1.0.0 (deterministic build) -->

Laravel Mix

⚠ Deprecated — superseded by laravel/vite. Laravel Mix is no longer the default; use Vite for asset bundling. Removal planned: 2028-01-15.

When to use

  • The user must maintain or debug an existing webpack.mix.js Laravel Mix asset pipeline that has not been migrated to Vite.
  • The user needs to fix or explain the mix() Blade helper and the mix-manifest.json it reads in a legacy project.
  • The user needs to edit webpack.mix.js chained calls such as mix.js, mix.sass, or mix.version in a legacy build.

When NOT to use

  • Do not use this skill to design the target Vite setup when migrating away from Mix; use laravel/vite for the destination pipeline.
  • Do not use this skill for a new Laravel app or a fresh asset pipeline; use laravel/vite instead.

Core guidance

  • Chain mix.version for cache-busted output — Chain .version() in webpack.mix.js so Mix appends a content hash and writes mix-manifest.json; resolve the file in Blade with the mix() helper.

Quick recipe

  1. In webpack.mix.js, keep the compile chain (for example mix.js('resources/js/app.js', 'public/js') and mix.sass(...)) and chain .version() so output is hashed. (verify: npm run prod regenerates public/js and mix-manifest.json)
  2. In the Blade layout, load the compiled assets with {{ mix('js/app.js') }} and {{ mix('css/app.css') }} so the current hashed paths are resolved. (verify: The rendered page links the hashed files listed in mix-manifest.json)

Best practices

  • In Blade, reference compiled assets with {{ mix('js/app.js') }} so the current hashed path is read from mix-manifest.json rather than hardcoding the filename
  • Run npm run dev for an unminified build while developing and npm run prod for a minified, versioned build on deploy; both invoke Mix via the package scripts

Common mistakes

  1. mix() throws when the manifest is missing — Calling mix() before running a build (or without .version()) throws because mix-manifest.json does not exist. Fix: Run npm run prod (with .version() chained) so the manifest is generated before the view renders.
  2. Newer Node versions break the aging webpack toolchain — Laravel Mix pins an older webpack stack, so a recent Node.js can fail the build with OpenSSL or loader errors. Fix: Pin a Node version known to work (or set NODE_OPTIONS=--openssl-legacy-provider) for the legacy build, and plan the migration to laravel/vite.

Version notes

  • Mix is in maintenance mode from Laravel 9 — From Laravel 9 onward Vite is the scaffolded default and Laravel Mix is in maintenance mode; Laravel 8 shipped Mix by default.

Security

  • Not applicable — no I/O, auth, or untrusted input.

Testing

  • Activation and decision behavior are verified in eval/scenarios/laravel/mix.yaml.

Additional resources

  • references/core.md
  • references/pitfalls.md
  • references/recipes.md
  • references/version-differences.md

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.