Rollup represents another recent addition and alternative. Users who've used webpack will find Rollup's configuration familiar and easy to set up:
We add the following Rollup dependencies:
"rollup": "=0.58.2",
"rollup-plugin-babel": "=3.0.4",
"rollup-plugin-uglify": "=3.0.0"
$ rollup -c rollup/rollup.dev.config.js --external all
import babel from 'rollup-plugin-babel';
export default {
entry: 'reactAppSrc/rollup.index.js',
dest: 'public/built/main.min.js',
format: 'iife',
plugins: [
babel({
babelrc: false,
exclude: 'node_modules/**',
presets: [
"react",
[
"es2015",
{
"modules": false
}
]
],
"plugins": [
"external-helpers"
]
})
],
};
$ rollup -c rollup/rollup.prod.config.js --external all
import babel from 'rollup-plugin-babel';
import uglify from 'rollup-plugin-uglify'
export default {
entry: 'reactAppSrc/rollup.index.js',
dest: 'public/built/main.min.js',
format: 'iife',
sourceMap: 'inline',
plugins: [
babel({
babelrc: false,
exclude: 'node_modules/**',
presets: [
"react",
[
"es2015",
{
"modules": false
}
]
],
"plugins": [
"external-helpers"
]
}),
uglify()
],
};