mercury-parser/rollup.config.web.js
Adam Pash 60a6861e18 Feat: browser support (#19)
Big undertaking to support Mercury in the browser. Builds are working and all tests are passing both for web and node builds. Most code is closely shared.
2016-11-21 14:17:06 -08:00

32 lines
876 B
JavaScript

/* eslint-disable import/no-extraneous-dependencies */
import babel from 'rollup-plugin-babel';
import babelrc from 'babelrc-rollup'; // eslint-disable-line import/extensions
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import globals from 'rollup-plugin-node-globals';
import uglify from 'rollup-plugin-uglify'; // eslint-disable-line import/extensions
const babelOpts = babelrc();
babelOpts.runtimeHelpers = true;
babelOpts.exclude = './node_modules/**';
export default {
entry: 'src/mercury.js',
plugins: [
babel(babelOpts),
commonjs({
ignoreGlobal: true,
}),
globals(),
nodeResolve({
browser: true,
preferBuiltins: false,
}),
uglify(),
],
format: 'iife',
moduleName: 'Mercury',
dest: 'dist/mercury.web.js', // equivalent to --output
sourceMap: false,
};