Skip to content

Instantly share code, notes, and snippets.

@ManzDev
Created February 24, 2018 17:13
Show Gist options
  • Save ManzDev/26edf8789409f60c88403f37811dccb1 to your computer and use it in GitHub Desktop.
Save ManzDev/26edf8789409f60c88403f37811dccb1 to your computer and use it in GitHub Desktop.
RollUp Config file for easy ES6 to ES5 bundle
import babel from 'rollup-plugin-babel';
import eslint from 'rollup-plugin-eslint';
import resolve from 'rollup-plugin-node-resolve';
import multiEntry from 'rollup-plugin-multi-entry';
import uglify from 'rollup-plugin-uglify';
import filesize from 'rollup-plugin-filesize';
import commonjs from 'rollup-plugin-commonjs';
import progress from 'rollup-plugin-progress';
let pluginOptions = [
multiEntry(),
resolve({
jsnext: true,
browser: true
}),
commonjs(),
eslint(),
progress(),
babel({
exclude: 'node_modules/**',
}),
uglify(),
filesize({
showGzippedSize: false,
})
];
export default [{
input: './src/js/index.es6',
output: {
name: 'main', // for external calls (need exports)
file: 'dist/js/index.min.js',
format: 'umd',
},
plugins: pluginOptions,
},
{
// ... // for multi entrypoints
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment