Skip to content

Instantly share code, notes, and snippets.

@kevinfiol
Created July 23, 2018 14:23
Show Gist options
  • Save kevinfiol/a05bc1fcb2e69172d0cd81fb2c7c893d to your computer and use it in GitHub Desktop.
Save kevinfiol/a05bc1fcb2e69172d0cd81fb2c7c893d to your computer and use it in GitHub Desktop.
multiple files rollup config
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