Compile code using Babel
Add peer dependencies:
$ yarn add -D rollup @babel/core
...then install config packages:
$ yarn add -D @azimutlabs/rollup-{config,config-babel}
// rollup.config.js
import babel from '@azimutlabs/rollup-config-babel';
export default babel(
// Output format. Defaults to 'es'
'cjs',
{
// Optional RollupOptions that will be merged with configuration options.
shimMissingExports: true,
// Optional RollupConfigPlugins<P> object that will be merged with
// configuration plugins.
pluginBuilders: {
// Merge with default '@rollup/plugin-babel' plugin options.
babel: {
babelHelpers: ['bundled'],
},
},
}
);
Any PR is welcomed by our @js-opensource team. Check out our contributing guidelines for more info.