forked from webex/widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
49 lines (46 loc) · 1.18 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
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import commonJS from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import postcss from 'rollup-plugin-postcss';
const output = (name, format) => ({
name,
file: `dist/webexWidgets.${format}.js`,
format,
sourcemap: true,
globals: {
'prop-types': 'PropTypes',
react: 'React',
'react-dom': 'ReactDOM',
webex: 'webex',
'@webex/common': '@webex/common',
},
});
export default [
{
input: 'src/index.js',
output: [output('ESMWebexWidgets', 'esm')],
plugins: [
resolve({
preferBuiltins: true,
extensions: ['.js', '.jsx'],
}),
babel({
compact: false,
runtimeHelpers: true,
}),
commonJS(),
json(),
postcss({extract: 'dist/webexWidgets.css'}),
],
onwarn(warning, warn) {
// skip circular dependency warnings from @momentum-ui/react library
if (warning.code === 'CIRCULAR_DEPENDENCY') return;
// Use default for everything else
warn(warning);
},
external: ['prop-types', 'react', 'react-dom', 'webex', '@webex/common'],
context: null,
},
];
9;