forked from apollographql/apollo-client
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
35 lines (32 loc) · 801 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
export const globals = {
// Apollo
'apollo-client': 'apollo.core',
'apollo-cache': 'apolloCache.core',
'apollo-link': 'apolloLink.core',
'apollo-link-dedup': 'apolloLink.dedup',
'apollo-utilities': 'apollo.utilities',
'graphql-anywhere': 'graphqlAnywhere',
};
export default (name, override = {}) =>
Object.assign(
{
input: 'lib/index.js',
output: {
file: 'lib/bundle.umd.js',
format: 'umd',
},
name,
exports: 'named',
sourcemap: true,
external: Object.keys(globals),
onwarn,
globals,
},
override,
);
function onwarn(message) {
const suppressed = ['UNRESOLVED_IMPORT', 'THIS_IS_UNDEFINED'];
if (!suppressed.find(code => message.code === code)) {
return console.warn(message.message);
}
}