-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathrollup.config.js
69 lines (67 loc) · 1.63 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
65
66
67
68
69
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import typescript from 'rollup-plugin-typescript';
import pkg from './package.json';
export default [
// Browser-friendly UMD build
{
input: 'src/index.ts',
output: {
name: 'visa-charts-utils',
file: pkg.browser,
format: 'umd'
},
// Suppress circular dependency warnings from d3
onwarn: function(warning, warn) {
if (warning.code === 'CIRCULAR_DEPENDENCY') return;
warn(warning);
},
plugins: [
resolve(),
commonjs({
include: [
'./node_modules/deep-keys/index.js',
'./node_modules/yup/lib/index.js',
'./node_modules/synchronous-promise/index.js',
'./node_modules/property-expr/index.js',
'node_modules/toposort/index.js'
]
}),
typescript({ include: '**/*.{ts,js}' }) // Convert TypeScript to JavaScript
]
},
// CommonJS (for Node) and ES module (for bundlers) build.
{
input: 'src/index.ts',
external: [],
plugins: [
resolve(),
commonjs({
include: [
'./node_modules/deep-keys/index.js',
'./node_modules/yup/lib/index.js',
'./node_modules/synchronous-promise/index.js',
'./node_modules/property-expr/index.js',
'node_modules/toposort/index.js'
]
}),
typescript() // Convert TypeScript to JavaScript
],
// Suppress circular dependency warnings from d3
onwarn: function(warning, warn) {
if (warning.code === 'CIRCULAR_DEPENDENCY') return;
warn(warning);
},
output: [
{
file: pkg.main,
format: 'cjs',
exports: 'auto' // Explicitly set exports to 'auto'
},
{
file: pkg.module,
format: 'es'
}
]
}
];