webpack-laravel-mix-manifest
raw JSON → 3.1.2 verified Sat Apr 25 auth: no javascript
A webpack plugin that generates a Laravel-compatible mix-manifest.json file for use with Laravel's `mix()` helper. Version 3.1.2 requires webpack 5 (use v2.x for webpack 4, v1.x for webpack 2/3). Ships TypeScript definitions. Active development with frequent updates. Key differentiator: enables Laravel versioned asset management without using Laravel Mix, supporting ESM, CJS, and TypeScript configurations.
Common errors
error TypeError: WebpackLaravelMixManifest is not a constructor ↓
cause Importing the plugin incorrectly as a default export instead of named export.
fix
Change import WebpackLaravelMixManifest from 'webpack-laravel-mix-manifest' to import { WebpackLaravelMixManifest } from 'webpack-laravel-mix-manifest'
error Module not found: Error: Can't resolve 'webpack-laravel-mix-manifest' ↓
cause Package not installed or incorrect npm install command.
fix
Run npm install webpack-laravel-mix-manifest --save-dev or yarn add webpack-laravel-mix-manifest --dev
error Error: webpack-laravel-mix-manifest requires webpack version 5. Found version 4.x.x ↓
cause Using plugin v3.x with webpack 4 or lower.
fix
Downgrade plugin to v2.x: npm install webpack-laravel-mix-manifest@2 --save-dev, or upgrade webpack to 5
Warnings
breaking Version 3.x requires webpack 5. Do not use with webpack 2, 3, or 4. ↓
fix Use version 2.x for webpack 4, version 1.x for webpack 2/3
deprecated Version 2.x is no longer maintained. Upgrade to 3.x if on webpack 5. ↓
fix Update to webpack 5 and use webpack-laravel-mix-manifest@3
gotcha The plugin must be imported as a named export; there is no default export. Using default import results in undefined. ↓
fix Use import { WebpackLaravelMixManifest } from 'webpack-laravel-mix-manifest'
gotcha The default output filename is 'mix-manifest.json'. If you want a different name, pass it to the constructor: new WebpackLaravelMixManifest('custom-manifest.json') ↓
fix Specify the filename as first argument if a custom name is needed
gotcha Duplicated paths can occur when using path-based entry points (e.g., './src/js/app.js' instead of just 'app.js'). This was fixed in v3.0.3 and v2.2.2. ↓
fix Upgrade to version 3.0.3+ or 2.2.2+
Install
npm install webpack-laravel-mix-manifest yarn add webpack-laravel-mix-manifest pnpm add webpack-laravel-mix-manifest Imports
- WebpackLaravelMixManifest wrong
import WebpackLaravelMixManifest from 'webpack-laravel-mix-manifest'correctimport { WebpackLaravelMixManifest } from 'webpack-laravel-mix-manifest'
Quickstart
// webpack.config.js (ESM)
import { WebpackLaravelMixManifest } from 'webpack-laravel-mix-manifest';
export default {
output: {
filename: '[name]-[contenthash].js',
path: 'public',
},
plugins: [
new WebpackLaravelMixManifest(),
],
};
// Run: npx webpack
// Generates 'public/mix-manifest.json' with versioned paths like:
// { "/js/main.js": "/js/main-abc123.js" }