-
Notifications
You must be signed in to change notification settings - Fork 4
/
rollup.config.js
35 lines (31 loc) · 1020 Bytes
/
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
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import { terser } from "rollup-plugin-terser";
import pkg from './package.json';
export default
// browser-friendly UMD build
{
input: 'index.js',
output: [
{name: 'figtree',file: pkg.browser,format: 'umd',sourcemap: true},
{file: pkg.main,format: 'cjs',sourcemap: true},
{file: pkg.module,format: 'es' ,sourcemap: true},
{name: 'figtree',file: pkg.browser.replace(".js",".min.js"),format: 'umd'},
{file: pkg.main.replace(".js",".min.js"),format: 'cjs'},
{file: pkg.module.replace(".js",".min.js"),format: 'es'},
],
plugins: [
resolve({
jsnext: true,
main: true,
browser: true
}), // so Rollup can find `d3`
babel({
runtimeHelpers: true,
exclude: 'node_modules/**',
}),
commonjs({include: ['src/*','node_modules/**']}), // so Rollup can convert `d3` to an ES module,
terser({include: [/^.+\.min\.js$/]})
]
};