Skip to content

Instantly share code, notes, and snippets.

@therealklanni
Created January 24, 2016 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save therealklanni/2beadc4745657b26f2c5 to your computer and use it in GitHub Desktop.
Save therealklanni/2beadc4745657b26f2c5 to your computer and use it in GitHub Desktop.
Rollup build script (good example)
import { rollup } from 'rollup';
import babel from 'rollup-plugin-babel';
rollup({
entry: 'index.js',
plugins: [ babel({ presets: [ 'es2015-rollup' ] }) ]
}).then(bundle => Promise.all([
bundle.write({
dest: 'dist/module.js',
format: 'cjs',
sourceMap: 'inline'
}),
bundle.write({
dest: 'dist/module.es2015.js',
format: 'es6',
sourceMap: 'inline'
})
])).catch(error => console.log(error));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment