Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soundcloud/chunk-manifest-webpack-plugin
Allows exporting a manifest that maps entry chunk names to their output files, instead of keeping the mapping inside the webpack bootstrap.
https://github.com/soundcloud/chunk-manifest-webpack-plugin
Last synced: about 1 month ago
JSON representation
Allows exporting a manifest that maps entry chunk names to their output files, instead of keeping the mapping inside the webpack bootstrap.
- Host: GitHub
- URL: https://github.com/soundcloud/chunk-manifest-webpack-plugin
- Owner: soundcloud
- License: mit
- Created: 2014-08-22T16:47:55.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-07-12T11:51:30.000Z (over 1 year ago)
- Last Synced: 2024-05-17T10:43:15.106Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 432 KB
- Stars: 394
- Watchers: 101
- Forks: 73
- Open Issues: 39
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE.md
Awesome Lists containing this project
README
# chunk-manifest-webpack-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.
## Usage
Install via npm:
```shell
npm install --save-dev chunk-manifest-webpack-plugin
```Install via yarn:
```shell
yarn add --dev chunk-manifest-webpack-plugin
```And then require and provide to webpack:
```javascript
// in webpack.config.js or similar
const ChunkManifestPlugin = require('chunk-manifest-webpack-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 %>```