targets-webpack-plugin

4.0.0 • Public • Published

targets-webpack-plugin npm

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-plugin

or

yarn add --dev targets-webpack-plugin

Usage

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

Readme

Keywords

none

Package Sidebar

Install

npm i targets-webpack-plugin

Weekly Downloads

1,939

Version

4.0.0

License

MIT

Unpacked Size

8.4 kB

Total Files

4

Last publish

Collaborators

  • sheerun