diff --git a/rollup.config.js b/rollup.config.js index 533ce99..828e3f0 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,6 +2,9 @@ import resolve from 'rollup-plugin-node-resolve' import commonjs from 'rollup-plugin-commonjs' import babel from 'rollup-plugin-babel' import pkg from './package.json' +import fs from 'fs' + +const babelrc = JSON.parse(fs.readFileSync('./.babelrc', 'utf8')) export default [ { @@ -14,7 +17,13 @@ export default [ plugins: [ resolve(), commonjs(), - babel(), + babel({ + // compile some libraries of sindresorhus with babel, because these are using es2015+ syntax but with commonjs. + // see: https://github.com/rollup/rollup-plugin-babel#external-dependencies + ...babelrc, + babelrc: false, + include: '**', + }), ], }, ]