Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Created August 29, 2016 22:28
Show Gist options
  • Save nolanlawson/f1321f1f366d5ce453ea69a440d49b62 to your computer and use it in GitHub Desktop.
Save nolanlawson/f1321f1f366d5ce453ea69a440d49b62 to your computer and use it in GitHub Desktop.
Rollup with all the trimmings
const rollup = require('rollup')
const nodeResolve = require('rollup-plugin-node-resolve')
const commonjs = require('rollup-plugin-commonjs')
const json = require('rollup-plugin-json')
rollup.rollup({
entry: 'index.js',
plugins: [
json(),
nodeResolve({
main: true,
extensions: [ '.js', '.json' ]
}),
commonjs()
]
}).then(function (bundle) {
return bundle.write({
format: 'cjs',
dest: 'bundle.js',
useStrict: false
})
}).catch(console.log.bind(console))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment