Created
August 29, 2016 22:28
-
-
Save nolanlawson/f1321f1f366d5ce453ea69a440d49b62 to your computer and use it in GitHub Desktop.
Rollup with all the trimmings
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
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