Skip to content

Instantly share code, notes, and snippets.

@kamleshchandnani
Forked from transitive-bullshit/rollup.config.js
Created November 10, 2017 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamleshchandnani/982c2206ebb80c530ea4022e749f4492 to your computer and use it in GitHub Desktop.
Save kamleshchandnani/982c2206ebb80c530ea4022e749f4492 to your computer and use it in GitHub Desktop.
example rollup config for react module transpilation
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import postcss from 'rollup-plugin-postcss'
import resolve from 'rollup-plugin-node-resolve'
import pkg from './package.json'
export default {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'cjs'
},
{
file: pkg.module,
format: 'es'
}
],
external: [
'react',
'react-dom',
'prop-types'
],
plugins: [
resolve(),
commonjs(),
postcss({}),
babel({ exclude: 'node_modules/**' })
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment