This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
107 lines (102 loc) · 2.98 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
import commonjs from 'rollup-plugin-commonjs';
import localResolve from 'rollup-plugin-local-resolve';
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import builtins from 'rollup-plugin-node-builtins';
import filesize from 'rollup-plugin-filesize';
import pkg from './package.json';
export default [
{
input: 'src/index.js',
output: [
{
file: pkg.main,
name: pkg.name,
globals: {
react: 'React',
'react-router': 'Link',
'react-transition-group': 'ReactTransitionGroup',
'styled-component': 'styled',
'bootstrap-styled': 'Jumbotron',
'@material-ui/core': 'material-ui',
'@material-ui/icons': 'material-ui',
classnames: 'cn',
'@material-ui/styles': 'styles',
'@mdi/js': 'js',
'@mdi/react': 'Icon',
'react-text-mask': 'MaskedInput',
'material-ui-search-bar': 'SearchBar',
'@tinymce/tinymce-react': 'tinymceReact',
'react-swipeable-views': 'SwipeableViews',
'material-ui-dots': 'Dots',
},
format: 'cjs',
sourcemap: true,
},
],
plugins: [
peerDepsExternal(),
builtins(),
babel({
exclude: ['node_modules/**'],
extensions: ['.js'],
}),
localResolve(),
resolve({
jsnext: true,
main: true,
browser: true,
}),
commonjs({
include: 'node_modules/**',
namedExports: {
'node_modules/@material-ui/core/colors/index.js': ['grey'],
'node_modules/react-sizeme/dist/react-sizeme.js': ['SizeMe'],
'node_modules/@material-ui/core/styles/index.js': ['createMuiTheme'],
'node_modules/text-mask-core/dist/textMaskCore.js': ['conformToMask'],
'node_modules/prop-types/index.js': [
'array',
'bool',
'func',
'number',
'object',
'string',
'symbol',
'any',
'arrayOf',
'element',
'elementType',
'instanceOf',
'node',
'objectOf',
'oneOf',
'oneOfType',
'shape',
'exact',
],
'node_modules/react-dom/index.js': ['findDOMNode', 'createPortal'],
'node_modules/react-is/index.js': ['ForwardRef', 'isFragment'],
'node_modules/@tecsinapse/es-utils/build/index.js': [
'isEmptyOrNull',
'isNotEmptyOrNull',
'flatten',
'getAnyFromArray',
'omitDeep',
'resolveObj',
'isNotUndefOrNull',
],
},
}),
filesize(),
],
onwarn(warning, warn) {
// skip certain warnings
if (warning.code === 'THIS_IS_UNDEFINED') {
return;
}
// Use default for everything else
warn(warning);
},
},
];