Skip to content

Instantly share code, notes, and snippets.

@eisisig
Created February 3, 2016 09:56
Show Gist options
  • Save eisisig/6bce3364d00d249d236e to your computer and use it in GitHub Desktop.
Save eisisig/6bce3364d00d249d236e to your computer and use it in GitHub Desktop.
Standard Configs to use with Rollup.js

Rollup Configs

If you haven't used or heard of Rollup it is an awesome bundling system that allows you to leverage es2015 modules and produce backwards compatible libraries.

Here are a few configs to help you bundle your apps.

import babel from 'rollup-plugin-babel';
import json from 'rollup-plugin-json';
var external = Object.keys( require( './package.json' ).dependencies ).concat( 'path' );
export default {
entry: 'lib/inutFile.js',
dest: 'dist/destinationFile.js',
format: 'umd',
external: external, //Keep your bundles smaller by excluding 3rd party modules.
plugins: [ json(), babel() ],
moduleName: 'ModuleName' //We have to give our module a name for its Universal Module Definition
};
import babel from 'rollup-plugin-babel';
import json from 'rollup-plugin-json';
var external = Object.keys( require( './package.json' ).dependencies ).concat( 'path' );
export default {
entry: 'lib/inutFile.js',
dest: 'dist/destinationFile.js',
format: 'cjs',
external: external, //Keep your bundles smaller by excluding 3rd party modules.
plugins: [ json(), babel() ]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment