-
Notifications
You must be signed in to change notification settings - Fork 3
/
rollup.config.js
82 lines (77 loc) · 1.56 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
70
71
72
73
74
75
76
77
78
79
80
81
82
import { terser } from 'rollup-plugin-terser';
import url from '@rollup/plugin-url';
import babel from '@rollup/plugin-babel';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
const babelConfig = {
babelHelpers: 'bundled',
'presets': [
'@babel/preset-react'
],
};
const external = [
'jsx-native-events',
'react',
'react-dom',
'prop-types',
'cubejs-uikit',
];
const plugins = [
terser(),
resolve({
mainFields: ['module', 'main', 'jsnext:main'],
extensions: ['.jsx', '.js'],
}),
commonjs(),
url(),
babel(babelConfig),
];
// function componentConfig(name) {
// return {
// input: `src/components/${name}.jsx`,
// external,
// output: [{
// name: `${name} Component`,
// dir: './dist/components/',
// format: 'es',
// }],
// plugins,
// };
// }
//
// function serviceConfig(name) {
// return {
// input: `src/services/${name}.js`,
// external,
// output: [{
// name: `${name} Service`,
// dir: './dist/services/',
// format: 'es',
// }],
// plugins,
// };
// }
export default [
{
input: 'src/core.js',
external,
output: [{
name: 'CubeJS UI Kit',
dir: './dist/',
format: 'es',
}],
plugins,
},
// {
// input: 'src/helpers.js',
// external,
// output: [{
// name: 'CubeJS UI Kit Helpers',
// dir: './dist/',
// format: 'es',
// }],
// plugins,
// },
// ...COMPONENT_LIST.map(componentConfig),
// ...SERVICE_LIST.map(serviceConfig),
];