-
Notifications
You must be signed in to change notification settings - Fork 4
/
rollup.config.js
43 lines (39 loc) · 1.11 KB
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* eslint-disable import/no-extraneous-dependencies, node/no-unpublished-require */
const resolve = require('rollup-plugin-node-resolve')
const babel = require('rollup-plugin-babel')
const commonjs = require('rollup-plugin-commonjs')
const json = require('rollup-plugin-json')
const uglify = require('rollup-plugin-uglify')
const visualizer = require('rollup-plugin-visualizer')
const sourcemaps = require('rollup-plugin-sourcemaps')
// eslint-disable-next-line no-console
console.log('Creating bundle...')
const targets = [{ dest: 'dist/fdk.min.js', format: 'umd' }]
const plugins = [
json(),
resolve({
jsnext: true,
main: true,
// NOTE setting browser to true makes sure only the browser relevant
// entry point for libraries is used e.g. isomorphic-fetch
browser: true,
preferBuiltins: false,
}),
commonjs(),
babel({
babelrc: false,
presets: [['env', { modules: false }]],
plugins: ['external-helpers'],
}),
uglify(),
visualizer(),
sourcemaps(),
]
module.exports = {
entry: 'lib/index.js',
moduleName: 'fdk',
exports: 'named',
sourceMap: true,
targets,
plugins,
}