evaluate-bundle-webpack-plugin
v0.0.3
Published
Webpack plugin that evaluates the built bundle and provides an emit callback
Downloads
7
Readme
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 |
:warning: This is in super alpha :warning: