Created
February 24, 2018 17:13
-
-
Save ManzDev/26edf8789409f60c88403f37811dccb1 to your computer and use it in GitHub Desktop.
RollUp Config file for easy ES6 to ES5 bundle
This file contains 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
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