Created
November 1, 2017 05:46
-
-
Save transitive-bullshit/ca776f2d8b7c379ef96a03cb81c8198e to your computer and use it in GitHub Desktop.
example rollup config for react module transpilation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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