https://github.com/znck/webpack-plugin-chunk-manifest
Record chunks in a JSON file
https://github.com/znck/webpack-plugin-chunk-manifest
plugin webpack
Last synced: 6 months ago
JSON representation
Record chunks in a JSON file
- Host: GitHub
- URL: https://github.com/znck/webpack-plugin-chunk-manifest
- Owner: znck
- License: mit
- Created: 2017-05-27T06:26:39.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-27T07:35:46.000Z (about 9 years ago)
- Last Synced: 2025-04-14T21:53:14.739Z (about 1 year ago)
- Topics: plugin, webpack
- Language: JavaScript
- Size: 146 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/webpack-plugin-chunk-manifest)
[](https://webpack.js.org/)
[](https://www.npmjs.com/package/webpack-plugin-chunk-manifest)
## Introduction
Export a JSON file that maps chunk ids to their resulting asset files. This JSON file could be used for prefetch/preload.
> Looking to contribute? Pick up [an issue](https://github.com/znck/webpack-plugin-chunk-manifest/issues)!
## Documentation
#### Installation
```bash
yarn add --dev webpack-plugin-chunk-manifest
```
#### Usage
``` js
// File: webpack.config.js
const ChunkManifest = require('webpack-plugin-chunk-manifest');
module.exports = {
...
plugins: [
new ChunkManifest(),
],
...
}
```
#### Options
- filename: Chunk manifest would be stored in this file. Default: `manifest.json`
``` js
new ChunkManifest({ filename: 'config/manifest.json' })
```
- transform: Transform chunks before storing.
``` js
new ChunkManifest({
tranform (chunks) {
// Remove manifest.js from chunks.
Object.keys(chunks).forEach(key => {
if (/manifest\.js$/.test(chunks[key])) {
delete chunks[key]
}
})
return chunks
}
})
```
## License
[MIT](http://opensource.org/licenses/MIT)