{"id":20703,"library":"webpack-assets-manifest","title":"Webpack Assets Manifest","description":"Webpack plugin that generates a JSON manifest mapping original filenames to their hashed output (e.g., main.js → main-9c68d5e8.js). v6.5.1 is the latest stable release, with frequent updates (~monthly). Written in TypeScript, ships its own types. Supports Subresource Integrity (SRI), entrypoint assets, custom sorting, merging, and hooks. A key differentiator is its built-in SRI and entrypoint handling, plus full webpack 5 compatibility. Requires Node >=20.10 and webpack ^5.61. No default export in v6 — use named import.","status":"active","version":"6.5.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/webdeveric/webpack-assets-manifest","tags":["javascript","webpack-assets-manifest","webpack-plugin","webpack","plugin","assets","manifest","json","subresource","typescript"],"install":[{"cmd":"npm install webpack-assets-manifest","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-assets-manifest","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-assets-manifest","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin hooks into webpack compilation lifecycle","package":"webpack","optional":false}],"imports":[{"note":"Since v6, the plugin is a named export, not default. CommonJS users must destructure from module.exports.","wrong":"const WebpackAssetsManifest = require('webpack-assets-manifest');\n// or: import WebpackAssetsManifest from 'webpack-assets-manifest'","symbol":"WebpackAssetsManifest","correct":"import { WebpackAssetsManifest } from 'webpack-assets-manifest'"},{"note":"The default export is removed in v6. Do NOT use .default.","wrong":"const WebpackAssetsManifest = require('webpack-assets-manifest').default","symbol":"WebpackAssetsManifest (CommonJS)","correct":"const { WebpackAssetsManifest } = require('webpack-assets-manifest')"},{"note":"Options is a TypeScript type, not a runtime value. Use type-only import to avoid bundling.","wrong":"import { Options } from 'webpack-assets-manifest' (if not using type-only)","symbol":"Options type","correct":"import type { Options } from 'webpack-assets-manifest'"}],"quickstart":{"code":"import { WebpackAssetsManifest } from 'webpack-assets-manifest';\n\nconst manifestPlugin = new WebpackAssetsManifest({\n  output: 'my-assets.json',\n  entrypoints: true,\n  integrity: true,\n  customize(entry, original, utils) {\n    if (entry.value && entry.value.match(/\\.map$/)) return false; // exclude sourcemaps\n    return entry;\n  }\n});\n\n// In webpack config:\nexport default {\n  plugins: [manifestPlugin]\n};\n\n// Access manifest after build:\nconsole.log(manifestPlugin.get('main.js'));\nconsole.log(manifestPlugin.getIntegrity('main.js'));","lang":"typescript","description":"Creates a manifest with integrity and entrypoints, filters out .map files, then accesses entries and SRI hashes after build."},"warnings":[{"fix":"Change `import WebpackAssetsManifest from 'webpack-assets-manifest'` to `import { WebpackAssetsManifest } from 'webpack-assets-manifest'`","message":"v6 removed default export; import must use named export `WebpackAssetsManifest`","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Set `output: 'manifest.json'` explicitly to retain old behavior or update downstream consumers.","message":"v5 changed default output filename to 'assets-manifest.json' (was 'manifest.json')","severity":"breaking","affected_versions":">=5.0.0 <6.0.0"},{"fix":"Update code that reads entrypoints to use the new nested structure.","message":"v4 entrypoints structure changed: assets now nested under `assets` property (e.g., `entrypoints.main.assets.js` instead of `entrypoints.main.js`)","severity":"deprecated","affected_versions":">=4.0.0 <5.0.0"},{"fix":"Ensure all option names match the documented schema exactly.","message":"Options schema in v5+ does not allow extra properties; typos in option names will throw validation errors","severity":"gotcha","affected_versions":">=5.0.0"},{"fix":"Use consistent hashing algorithm; if exact match needed, consider using webpack's Subresource Integrity plugin directly.","message":"SRI hash generation may produce different hashes than Webpack's built-in SRI plugin due to different hash splitting logic (v6.0.2+)","severity":"gotcha","affected_versions":">=6.0.2"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"import { WebpackAssetsManifest } from 'webpack-assets-manifest'","cause":"Using default import in v6 when only named export exists","error":"TypeError: WebpackAssetsManifest is not a constructor"},{"fix":"Install with `npm install -D webpack-assets-manifest` and ensure Node >=20.10","cause":"Package not installed or Node.js version below 20.10 (v6 requires >=20.10)","error":"Cannot find module 'webpack-assets-manifest'"},{"fix":"Check valid option names in the schema; use 'entrypointsUseAssets' only for v4, for v5+ use 'entrypoints: true'","cause":"Option name typo or used in v5+ (property renamed or removed)","error":"ValidationError: Invalid options object. 'WebpackAssetsManifest' has an unknown property 'entrypointsUseAssets'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}