webpack-chunks-api-plugin
v0.0.2
Published
webpack plugin to make chunk information available to the bundle via __webpack_chunks__
Downloads
5
Readme
webpack-chunks-api-plugin
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.