babelrc-rollup
Builds a babel configuration for rollup-plugin-babel by reading .babelrc.
Install
$ npm install --save-dev babelrc-rollup
Usage
Create a .babelrc
file at the root of your project as normal:
{
"presets": ["es2015"]
}
Inside your rollup.config.js
, do this:
import babelrc from 'babelrc-rollup';
import babel from 'rollup-plugin-babel';
export default {
…
plugins: [
babel(babelrc())
]
…
};
If you use the es2015
preset, make sure you install es2015-rollup
too. See
this project's own rollup.config.js
for an example.