https://github.com/jakeniemiec/webpack-chunk-manifest-plugin
Allows exporting a manifest that maps chunk ids to their output files, instead of keeping the mapping inside the webpack bootstrap.
https://github.com/jakeniemiec/webpack-chunk-manifest-plugin
chunk fingerprint hash manifest plugin webpack webpack3
Last synced: about 2 months ago
JSON representation
Allows exporting a manifest that maps chunk ids to their output files, instead of keeping the mapping inside the webpack bootstrap.
- Host: GitHub
- URL: https://github.com/jakeniemiec/webpack-chunk-manifest-plugin
- Owner: jakeNiemiec
- License: mit
- Created: 2017-07-21T21:37:25.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-21T22:10:41.000Z (about 8 years ago)
- Last Synced: 2025-08-16T01:55:24.781Z (2 months ago)
- Topics: chunk, fingerprint, hash, manifest, plugin, webpack, webpack3
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# webpack-chunk-manifest-plugin
Allows exporting a JSON file that maps chunk ids to their resulting asset files. Webpack can then read this mapping, assuming it is provided somehow on the client, instead of storing a mapping (with chunk asset hashes) in the bootstrap script, which allows to actually leverage long-term caching.
[](https://npmjs.org/package/webpack-chunk-manifest-plugin)
##### This repo was (lovingly) forked from [soundcloud/chunk-manifest-webpack-plugin](https://github.com/soundcloud/chunk-manifest-webpack-plugin).
## Usage
Install via npm:
```shell
npm install --save-dev webpack-chunk-manifest-plugin
```Install via yarn:
```shell
yarn add --dev webpack-chunk-manifest-plugin
```And then require and provide to webpack:
```javascript
// in webpack.config.js or similar
const ChunkManifestPlugin = require('webpack-chunk-manifest-plugin');module.exports = {
// your config values here
plugins: [
new ChunkManifestPlugin({
filename: 'manifest.json',
manifestVariable: 'webpackManifest',
inlineManifest: false
})
]
};
```### Options
#### `filename`
Where the manifest will be exported to on bundle compilation. This will be relative to the main webpack output directory. Default = `"manifest.json"`
#### `manifestVariable`
What JS variable on the client webpack should refer to when requiring chunks. Default = `"webpackManifest"`
#### `inlineManifest`
Whether or not to write the manifest output into the [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin). Default = `false`
```html
// index.ejs
<%= htmlWebpackPlugin.files.webpackManifest %>```