forked from c3js/c3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
48 lines (47 loc) · 1001 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
36
37
38
39
40
41
42
43
44
45
46
47
48
import babel from 'rollup-plugin-babel'
import modify from 'rollup-plugin-modify'
import pkg from './package.json'
export default [
{
input: 'src/index.js',
output: {
file: 'htdocs/js/c3.js',
name: 'c3',
format: 'umd',
banner: `/* @license C3.js v${pkg.version} | (c) C3 Team and other contributors | http://c3js.org/ */`,
globals: {
d3: 'd3'
}
},
plugins: [
babel({
presets: [
[
'@babel/preset-env',
{
modules: false
}
]
]
})
],
external: ['d3']
},
{
input: 'src/index.js',
output: {
file: 'htdocs/js/c3.esm.js',
name: 'c3',
format: 'es',
banner: `/* @license C3.js v${pkg.version} | (c) C3 Team and other contributors | http://c3js.org/ */`,
intro: `import * as d3 from 'd3';`
},
plugins: [
modify({
find: /\$\$\.d3 =.+?;/,
replace: '$$.d3 = d3;'
})
],
external: ['d3']
}
]