Skip to content

Instantly share code, notes, and snippets.

@miaulightouch
Created August 17, 2018 15:28
Show Gist options
  • Save miaulightouch/7fa7b42369b216873183ba38e8ab8265 to your computer and use it in GitHub Desktop.
Save miaulightouch/7fa7b42369b216873183ba38e8ab8265 to your computer and use it in GitHub Desktop.
// rollup.config.js
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
const esm = process.env.BABEL_ENV === 'esm'
export default {
input: 'src/index.js',
output: {
format: esm ? 'esm' : 'cjs',
file: `bundle.js`,
dir: esm ? 'esm' : 'lib'
},
plugins: [
resolve(),
commonjs()
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment