{"name":"webpack-manifest-plugin","version":"6.0.1","description":"A Webpack Plugin for generating Asset Manifests","license":"MIT","repository":{"type":"git","url":"git+https://github.com/shellscape/webpack-manifest-plugin.git"},"author":{"name":"Dane Thurber","email":"dane.thurber@gmail.com"},"homepage":"https://github.com/shellscape/webpack-manifest-plugin","bugs":{"url":"https://github.com/shellscape/webpack-manifest-plugin/issues"},"main":"dist/index.js","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"engines":{"node":">=20.19.0"},"peerDependencies":{"webpack":"^5.75.0"},"dependencies":{"tapable":"^2.0.0","webpack-sources":"^3.3.3"},"devDependencies":{"@svgr/webpack":"^8.1.0","@types/node":"^24.9.2","@types/webpack":"^5.28.0","@types/webpack-sources":"^3.2.3","@wordpress/dependency-extraction-webpack-plugin":"^6.34.0","copy-webpack-plugin":"^13.0.1","del":"^8.0.1","eslint":"^8.57.0","eslint-config-shellscape":"^6.0.0","eslint-import-resolver-typescript":"^4.4.4","file-loader":"^6.2.0","husky":"9.1.7","lint-staged":"16.2.6","memory-fs":"^0.5.0","pre-commit":"^1.2.2","prettier":"^3.6.2","prettier-plugin-package":"^2.0.0","react":"^19.2.0","style-loader":"^4.0.0","tslib":"^2.3.0","typescript":"^5.6.3","vitest":"^4.0.5","webpack":"^5.75.0","webpack-merge":"^6.0.1"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,ts,tsx,cjs,mjs}":["eslint --fix"]},"maintainers":[{"name":"danethurber","email":"dane.thurber@gmail.com"},{"name":"shellscape","email":"andrew@shellscape.org"}],"pre-commit":"lint-staged","scripts":{"build":"tsc --project tsconfig.json","ci:lint":"pnpm lint && pnpm security","ci:test":"vitest run","lint":"pnpm lint:docs && pnpm lint:json && pnpm lint:js","lint-staged":"lint-staged","lint:docs":"prettier --write README.md","lint:js":"eslint --cache --fix src test","lint:json":"prettier --write package.json","security":"pnpm audit --audit-level=high --prod","test":"vitest run"},"_id":"webpack-manifest-plugin@6.0.1","types":"./dist/index.d.ts","_integrity":"sha512-R0p/8/IJVY5hIhQtkeWUQugalVpIwojc09eb14zGq+oiZOCmN5paAz2NBJfd+6v9eBbxAS3YMjc2ov8UMlCDLQ==","_resolved":"/private/var/folders/07/ywbfgwc57_z4yx4m8vzhr8580000gp/T/a5a5e0ce7a617c2fc67cbcbe2036a732/webpack-manifest-plugin-6.0.1.tgz","_from":"file:webpack-manifest-plugin-6.0.1.tgz","_nodeVersion":"20.19.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-R0p/8/IJVY5hIhQtkeWUQugalVpIwojc09eb14zGq+oiZOCmN5paAz2NBJfd+6v9eBbxAS3YMjc2ov8UMlCDLQ==","shasum":"8db0b6b75bd8635fcee657f025dff3bc9ba77fb4","tarball":"http://registry-npm.ywwl.com/webpack-manifest-plugin/download/webpack-manifest-plugin-6.0.1.tgz","fileCount":12,"unpackedSize":35521,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHlUAMro0C9YXoOmGIMIz/3N5l+b0gZ/xIrpMB6yphiDAiAeYmSr+QNr65J9Ic655q5ROkQIkllfMJPEvWSBWmSfCg=="}],"size":10655,"noattachment":false,"key":"/webpack-manifest-plugin/-/webpack-manifest-plugin-6.0.1.tgz"},"_npmUser":{"name":"shellscape","email":"andrew@shellscape.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/webpack-manifest-plugin_6.0.1_1762095548532_0.5252754385093561"},"_hasShrinkwrap":false,"readme":"[size]: https://packagephobia.now.sh/badge?p=webpack-manifest-plugin\n[size-url]: https://packagephobia.now.sh/result?p=webpack-manifest-plugin\n\n<div align=\"center\">\n\t<img width=\"256\" src=\"https://raw.githubusercontent.com/shellscape/webpack-manifest-plugin/master/assets/manifest.svg?sanitize=true\" alt=\"webpack-manfiest-plugin\"><br/><br/>\n</div>\n\n[![size][size]][size-url]\n[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com)\n\n# webpack-manifest-plugin\n\nA Webpack plugin for generating an asset manifest.\n\n:heart: Please consider [Sponsoring my work](https://github.com/sponsors/shellscape)\n\n## Requirements\n\n`webpack-manifest-plugin` is an [evergreen 🌲](./.github/FAQ.md#what-does-evergreen-mean) module.\n\nThis module now requires Node.js v20.19.0 or newer and Webpack v5.0.0.\n\n## Contributing\n\nThis repository leverages [pnpm](https://pnpm.js.org/) for dependency management.\n\nTo begin, please install `pnpm`:\n\n```console\n$ npm install pnpm -g\n```\n\n## Install\n\nUsing npm:\n\n```console\nnpm install webpack-nano webpack-manifest-plugin --save-dev\n```\n\n_Note: We recommend using [webpack-nano](https://github.com/shellscape/webpack-nano), a very tiny, very clean webpack CLI._\n\n## Usage\n\nCreate a `webpack.config.js` or `webpack.config.mjs` file (ESM):\n\n```js\nimport { WebpackManifestPlugin } from 'webpack-manifest-plugin';\n\nexport default {\n  // an example entry definition\n  entry: ['app.js'],\n  // ...\n  plugins: [new WebpackManifestPlugin(/* options */)]\n};\n```\n\nAnd run `webpack`:\n\n```console\n$ npx wp\n```\n\nWith the default options, the example above will create a `manifest.json` file in the output directory for the build. The manifest file will contain a map of source filenames to the corresponding build output file. e.g.\n\n```json\n{\n  \"dist/batman.js\": \"dist/batman.1234567890.js\",\n  \"dist/joker.js\": \"dist/joker.0987654321.js\"\n}\n```\n\n### Options\n\n### `assetHookStage`\n\nType: `Number`<br>\nDefault: `Infinity`\n\nIf you need to consume the output of this plugin in another plugin, it can be useful to adjust the stage at which the manifest is generated. Pass a new stage to `assetHookStage` to change when the manifest is generated. See the [docs on `processAssets`](https://webpack.js.org/api/compilation-hooks/#list-of-asset-processing-stages) for more detail.\n\nNote: any files added to the compilation after the stage specified will not be included in the manifest.\n\n### `basePath`\n\nType: `String`<br>\nDefault: `''`\n\nSpecifies a path prefix for all keys in the manifest. Useful for including your output path in the manifest.\n\n### `fileName`\n\nType: `String`<br>\nDefault: `manifest.json`\n\nSpecifies the file name to use for the resulting manifest. By default the plugin will emit `manifest.json` to your output directory. Passing an absolute path to the `fileName` option will override both the file name and path.\n\n### `filter`\n\nType: `Function`<br>\nDefault: `undefined`\n\nAllows filtering the files which make up the manifest. The passed function should match the signature of `(file: FileDescriptor) => Boolean`. Return `true` to keep the file, `false` to remove the file.\n\n### `generate`\n\nType: `Function`<br>\nDefault: `undefined`\n\nA custom `Function` to create the manifest. The passed function should match the signature of `(seed: Object, files: FileDescriptor[], entries: string[]) => Object` and can return anything as long as it's serialisable by `JSON.stringify`.\n\n### `map`\n\nType: `Function`<br>\nDefault: `undefined`\n\nAllows modifying the files which make up the manifest. The passed function should match the signature of `(file: FileDescriptor) => FileDescriptor` where an object matching `FileDescriptor` is returned.\n\n### `publicPath`\n\nType: `String`<br>\nDefault: `<webpack-config>.output.publicPath`\n\nA path prefix that will be added to values of the manifest.\n\n### `removeKeyHash`\n\nType: `RegExp | false`<br>\nDefault: `/([a-f0-9]{32}\\.?)/gi`\n\nIf set to a valid `RegExp`, removes hashes from manifest keys. e.g.\n\n```json\n{\n  \"index.c5a9bff71fdfed9b6046.html\": \"index.c5a9bff71fdfed9b6046.html\"\n}\n```\n\n```json\n{\n  \"index.html\": \"index.c5a9bff71fdfed9b6046.html\"\n}\n```\n\nThe default value for this option is a regular expression targeting Webpack's [default md5 hash](https://webpack.js.org/configuration/output/#outputhashfunction). To target other hashing functions / algorithms, set this option to an appropriate `RegExp`. To disable replacing the hashes in key names, set this option to `false`.\n\n### `seed`\n\nType: `Object`<br>\nDefault: `{}`\n\nA cache of key/value pairs used to seed the manifest. This may include a set of [custom key/value](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json) pairs to include in your manifest, or may be used to combine manifests across compilations in [multi-compiler mode](https://github.com/webpack/webpack/tree/master/examples/multi-compiler). To combine manifests, pass a shared seed object to each compiler's `WebpackManifestPlugin` instance.\n\n### `serialize`\n\nType: `Function(Object) => string`<br>\nDefault: `undefined`\n\nA `Function` which can be leveraged to serialize the manifest in a different format than json. e.g. `yaml`.\n\n### `sort`\n\nType: `Function`<br>\nDefault: `undefined`\n\nAllows sorting the files which make up the manifest. The passed function should match the signature of `(fileA: FileDescriptor, fileB: FileDescriptor) => Number`. Return `0` to indicate no change, `-1` to indicate the file should be moved to a lower index, and `1` to indicate the file shoud be moved to a higher index.\n\n### `useEntryKeys`\n\nType: `Boolean`<br>\nDefault: `false`\n\nIf `true`, the keys specified in the `entry` property will be used as keys in the manifest. No file extension will be added (unless specified as part of an `entry` property key).\n\n### `useLegacyEmit`\n\nType: `Boolean`<br>\nDefault: `false`\n\nIf `true`, the manifest will be written on the deprecated webpack `emit` hook to be compatible with not yet updated webpack plugins.\n\nA lot of webpack plugins are not yet updated to match the new webpack 5 API. This is a problem when other plugins use the deprecated `emit` hook. The manifest will be written before these other plugins and thus files are missing on the manifest.\n\n### `writeToFileEmit`\n\nType: `Boolean`<br>\nDefault: `false`\n\nIf `true`, will emit the manifest to the build directory _and_ in memory for compatibility with `webpack-dev-server`.\n\n## Manifest File Descriptor\n\nThis plugin utilizes the following object structure to work with files. Many options for this plugin utilize the structure below.\n\n```ts\n{\n  chunk?: Chunk;\n  isAsset: boolean;\n  isChunk: boolean;\n  isInitial: boolean;\n  isModuleAsset: boolean;\n  name: string | null;\n  path: string;\n}\n```\n\n### `chunk`\n\nType: [`Chunk`](https://github.com/webpack/webpack/blob/master/lib/Chunk.js)\n\nOnly available if `isChunk` is `true`\n\n### `isInitial`\n\nType: `Boolean`\n\nIs required to run you app. Cannot be `true` if `isChunk` is `false`.\n\n### `isModuleAsset`\n\nType: `Boolean`\n\nIs required by a module. Cannot be `true` if `isAsset` is `false`.\n\n## Compiler Hooks\n\nThis plugin supports the following hooks via the `getCompilerHooks` export; `afterEmit`, `beforeEmit`. These hooks can be useful, e.g. changing manifest contents before emitting to disk.\n\n### `getCompilerHooks`\n\nReturns: `{ afterEmit: SyncWaterfallHook, beforeEmit: SyncWaterfallHook }`\n\n#### Usage\n\n```js\nconst { getCompilerHooks } = require('webpack-manifest-plugin');\n\nclass BatmanPlugin {\n  apply(compiler) {\n    const { beforeEmit } = getCompilerHooks(compiler);\n\n    beforeEmit.tap('BatmanPlugin', (manifest) => {\n      return { ...manifest, name: 'hello' };\n    });\n  }\n}\n```\n\n## Notes\n\n- If using this plugin with `webpack-clean` and `webpack-dev-server`, please review [this issue](https://github.com/shellscape/webpack-manifest-plugin/issues/267).\n\n## Attiribution\n\nSpecial thanks to [Dane Thurber](https://github.com/danethurber), the original author of this plugin, without whom this plugin would not exist.\n\n## Meta\n\n[CONTRIBUTING](./.github/CONTRIBUTING.md)\n\n[LICENSE (MIT)](./LICENSE)\n","publish_time":1762095548722,"_cnpm_publish_time":1762095548722,"dist-tags":{"beta":"1.1.0-0","latest":"6.0.1","next":"3.0.0-rc.0"}}