targets-webpack-plugin
v4.0.0
Published
Webpack plugin for legacy browser transcompilation (including dependencies)
Readme
targets-webpack-plugin 
A babel plugin for transcompiling final bundles so they support legacy browsers.
This plugin runs babel and rollup only once per asset, at the end of the compilation process.
Installation
npm install --save-dev targets-webpack-pluginor
yarn add --dev targets-webpack-pluginUsage
Add TargetsPlugin to the list of plugins.
// next.config.js
const TargetsPlugin = require("targets-webpack-plugin");
module.exports = {
webpack: function (config, { dev }) {
if (!dev) {
config.plugins.push(new TargetsPlugin({
browsers: ["last 2 versions", "chrome >= 41"]
}))
}
return config
}
}License
MIT
