0.0.2 • Published 8 years ago

webpack-chunks-api-plugin v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

webpack-chunks-api-plugin

npm

webpack plugin to make chunk information available to the bundle via __webpack_chunks__

Installation

npm install webpack@1 webpack-chunks-api-plugin

Usage

// webpack.config.js
const ChunksApiPlugin = require('webpack-chunks-api-plugin');

module.exports = {
  // ...
  plugins: [
    new ChunksApiPlugin(),
  ],
};

Then, in your bundle, you can access the IDs and paths of dynamically-loaded chunks via __webpack_chunks__. Note: __webpack_chunks__ only includes dynamically-loaded chunks; the entry chunk is not included.

Example

console.info(JSON.stringify(__webpack_chunks__));
// [{"id":1,"path":"1.bundle.js"},{"id":2,"path":"2.bundle.js"}]

See example/ for more.