Created
July 23, 2018 14:23
-
-
Save kevinfiol/a05bc1fcb2e69172d0cd81fb2c7c893d to your computer and use it in GitHub Desktop.
multiple files rollup config
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 nodeResolve from 'rollup-plugin-node-resolve'; | |
import commonjs from 'rollup-plugin-commonjs'; | |
import buble from 'rollup-plugin-buble'; | |
import uglify from 'rollup-plugin-uglify'; | |
import json from 'rollup-plugin-json'; | |
const paths = [ | |
['client/components/SearchComponent.js', 'web/js/components/SearchComponent.js'] | |
]; | |
const configs = paths.map((path) => { | |
return { | |
input: path[0], | |
output: { | |
file: path[1], | |
format: 'iife' | |
}, | |
plugins: [ | |
json({ exclude: 'node_modules/**', preferConst: true }), | |
nodeResolve(), | |
commonjs(), | |
buble({ transforms: { forOf: false } }), | |
((process.env.PROD === 'true') && uglify()) | |
] | |
}; | |
}); | |
export default configs; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment