https://github.com/sheerun/targets-webpack-plugin
Webpack plugin for transcompilig final bundles so they support legacy browsers
https://github.com/sheerun/targets-webpack-plugin
babel webpack webpack-plugin
Last synced: 12 months ago
JSON representation
Webpack plugin for transcompilig final bundles so they support legacy browsers
- Host: GitHub
- URL: https://github.com/sheerun/targets-webpack-plugin
- Owner: sheerun
- License: mit
- Created: 2018-04-26T14:19:51.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-17T00:35:36.000Z (over 4 years ago)
- Last Synced: 2025-06-16T16:09:12.200Z (about 1 year ago)
- Topics: babel, webpack, webpack-plugin
- Language: JavaScript
- Homepage:
- Size: 23.4 KB
- Stars: 15
- Watchers: 2
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# targets-webpack-plugin [](https://www.npmjs.com/package/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-plugin
```
or
```
yarn add --dev targets-webpack-plugin
```
## Usage
Add TargetsPlugin to the list of plugins.
```js
// 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