-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
rollup.config.js
64 lines (59 loc) · 1.3 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import {terser} from 'rollup-plugin-terser';
import json from '@rollup/plugin-json';
import license from 'rollup-plugin-license';
const jsonPlugin = json({include: 'package.json', preferConst: true});
const licensePlugin = license({
sourcemap: true,
banner: {
content: {
file: 'LICENSE_BANNER'
}
}
});
const d3Modules = {
'd3': 'd3',
'd3-array': 'd3',
'd3-axis': 'd3',
'd3-brush': 'd3',
'd3-collection': 'd3',
'd3-dispatch': 'd3',
'd3-ease': 'd3',
'd3-format': 'd3',
'd3-geo': 'd3',
'd3-hierarchy': 'd3',
'd3-interpolate': 'd3',
'd3-scale-chromatic': 'd3',
'd3-scale': 'd3',
'd3-selection': 'd3',
'd3-shape': 'd3',
'd3-time': 'd3',
'd3-time-format': 'd3',
'd3-timer': 'd3',
'd3-zoom': 'd3'
};
const umdConf = {
file: 'dist/dc.js',
format: 'umd',
name: 'dc',
sourcemap: true,
globals: d3Modules,
paths: d3Modules
};
const umdMinConf = Object.assign({}, umdConf, {
file: 'dist/dc.min.js',
plugins: [terser()]
});
export default [
{
input: 'src/index-with-version.js',
external: Object.keys(d3Modules),
plugins: [
jsonPlugin,
licensePlugin
],
output: [
umdConf,
umdMinConf
]
}
];