Skip to content

Instantly share code, notes, and snippets.

@transitive-bullshit
Created November 1, 2017 05:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save transitive-bullshit/ca776f2d8b7c379ef96a03cb81c8198e to your computer and use it in GitHub Desktop.
Save transitive-bullshit/ca776f2d8b7c379ef96a03cb81c8198e 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