A webpack plugin for Babili (now babel-minify), a babel-based minifier. The plugin operates on entire chunks/bundles, offering better toplevel scope optimizations compared to using babili as a babel-loader preset. Version 0.1.2 is the last under the babili name; it was renamed to babel-minify-webpack-plugin starting from v0.2.0. This package is deprecated; users should migrate to babel-minify-webpack-plugin or use TerserPlugin for webpack. Supports options like test, comments, sourceMap, parserOpts, and custom babel/babili instances.
npm install babili-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Basic webpack configuration using BabiliPlugin to minify the output bundle, disabling comments and source maps.
npm uninstall babili-webpack-plugin && npm install --save-dev babel-minify-webpack-plugin
Pass babili preset options as first argument and overrides (test, comments, etc.) as second argument.
Upgrade to webpack >= 4 or stick to earlier version of this plugin.
Avoid using babili as a preset in babel-loader if you use this plugin; let the plugin handle minification.
npm install babili-webpack-plugin --save-dev
Use const BabiliPlugin = require('babili-webpack-plugin');Instantiate with new BabiliPlugin(babiliOptions, overrides) where babiliOptions is the first argument.