evaluate-bundle-webpack-plugin

0.0.3 • Public • Published

evaluate-bundle-webpack-plugin

Evaluates the freshly built bundle and executes a callback right before chunks are emitted. The callback is expected to return an object of additional chunks keyed by the relative chunk name.

Usage

Add evaluate-bundle-webpack-plugin to the plugins section of your webpack config.

const EvaluateBundlePlugin = require('evaluate-bundle-webpack-plugin');
 
module.exports = {
  // ...
  plugins: [
    new EvaluateBundlePlugin({
      callback: function(bundle, stats) {
        return {
          'robots.txt': 'User-agent: *\nDisallow:\n',
        };
      }
    }),
  ],
  // ...
};

Configuration

Option Description
callback Function that receives two parameters: the exports of the entrypoint of the evaluated bundle and the stats object from the compilation

⚠️ This is in super alpha ⚠️

Readme

Keywords

none

Package Sidebar

Install

npm i evaluate-bundle-webpack-plugin

Weekly Downloads

3

Version

0.0.3

License

MIT

Last publish

Collaborators

  • meyer