Allows exporting a manifest that maps entry chunk names to their output files, instead of keeping the mapping inside the webpack bootstrap.
JavaScript
Latest commit 05d5890 Jan 2, 2017 @diurnalist diurnalist committed on GitHub Merge pull request #20 from JackuB/patch-1
Update webpack peerDependency
Permalink
Failed to load latest commit information.
lib Use the webpack 2 chunk api Jul 17, 2016
.gitignore Initial commit Aug 22, 2014
LICENSE.md Initial commit Aug 22, 2014
README.md Added yarn install Dec 6, 2016
package.json chore: update webpack peerDependency Dec 27, 2016

README.md

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:

npm install chunk-manifest-webpack-plugin

Install via yarn:

yarn add chunk-manifest-webpack-plugin

And then require and provide to webpack:

// in webpack.config.js or similar
var ChunkManifestPlugin = require('chunk-manifest-webpack-plugin');

module.exports = {
  // your config values here
  plugins: [
    new ChunkManifestPlugin({
      filename: "manifest.json",
      manifestVariable: "webpackManifest"
    })
  ]
};

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"