UNPKG

2.68 kBMarkdownView Raw
1# rollup-plugin-babel-minify
2
3[![Build Status](https://github.com/Comandeer/rollup-plugin-babel-minify/workflows/CI/badge.svg)](https://github.com/Comandeer/rollup-plugin-babel-minify/actions) [![codecov](https://codecov.io/gh/Comandeer/rollup-plugin-babel-minify/branch/master/graph/badge.svg)](https://codecov.io/gh/Comandeer/rollup-plugin-babel-minify) [![Dependency Status](https://david-dm.org/Comandeer/rollup-plugin-babel-minify.svg)](https://david-dm.org/Comandeer/rollup-plugin-babel-minify) [![devDependencies Status](https://david-dm.org/Comandeer/rollup-plugin-babel-minify/dev-status.svg)](https://david-dm.org/Comandeer/rollup-plugin-babel-minify?type=dev) [![npm](https://img.shields.io/npm/v/rollup-plugin-babel-minify.svg)](https://www.npmjs.com/package/rollup-plugin-babel-minify)
4
5Allows using [babel-minify](https://github.com/babel/minify) with [Rollup](https://rollupjs.org/guide/en).
6
7## ☠️ Project is deprecated! ☠️
8
9Version 10.0.0, released on 2020-03-14, will be the last version of the project, as [`babel-minify` is basically dead](https://github.com/babel/minify/issues/952). Please consider using [`rollup-plugin-terser`](https://www.npmjs.com/package/rollup-plugin-terser) instead.
10
11## Installation
12
13```bash
14npm install rollup-plugin-babel-minify [--save-dev]
15```
16
17## Usage
18
19```javascript
20import { rollup } from 'rollup';
21import minify from 'rollup-plugin-babel-minify';
22
23rollup( {
24 input: './src/index.js',
25 plugins: [
26 minify( {
27 // Options for babel-minify.
28 } )
29 ]
30} );
31```
32
33For the list of options, check [babel-minify preset's docs](https://github.com/babel/minify/blob/master/packages/babel-preset-minify/README.md#options).
34
35There are additional options:
36
37* `comments` (default: `true`): indicates if comments should be preserved in source;
38* `banner` (default: `undefined`): the comment which should be prepended to the transformed bundle;
39* `bannerNewLine` (since 4.0.0, default: `false`): indicates if the banner comment should be followed by a new line;
40* `sourceMap` (default: `true`): indicates if sourcemap should be generated;
41* `plugins` (since 6.2.0): indicates which Babel plugins should be loaded alongside [minify preset](https://github.com/babel/minify/tree/master/packages/babel-preset-minify); two plugins are loaded by default:
42 * [`@comandeer/babel-plugin-banner`](https://www.npmjs.com/package/@comandeer/babel-plugin-banner),
43 * [`@babel/plugin-syntax-dynamic-import`](https://www.npmjs.com/package/@babel/plugin-syntax-dynamic-import) (since 7.0.0).
44
45Check [API docs](https://comandeer.github.io/rollup-plugin-babel-minify) for more detailed description.
46
47## License
48
49See [LICENSE](./LICENSE) file for details.