forked from apollographql/apollo-link
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
39 lines (33 loc) · 929 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
36
37
38
39
import sourcemaps from 'rollup-plugin-sourcemaps';
export const globals = {
// Apollo
'apollo-client': 'apollo.core',
'apollo-link': 'apolloLink.core',
'apollo-link-batch': 'apolloLink.batch',
'apollo-utilities': 'apollo.utilities',
'apollo-link-http-common': 'apolloLink.httpCommon',
'zen-observable-ts': 'apolloLink.zenObservable',
//GraphQL
'graphql/language/printer': 'printer',
'zen-observable': 'Observable',
};
export default name => ({
input: 'lib/index.js',
output: {
file: 'lib/bundle.umd.js',
format: 'umd',
name: `apolloLink.${name}`,
globals,
sourcemap: true,
exports: 'named',
},
external: Object.keys(globals),
onwarn,
plugins: [sourcemaps()],
});
export function onwarn(message) {
const suppressed = ['UNRESOLVED_IMPORT', 'THIS_IS_UNDEFINED'];
if (!suppressed.find(code => message.code === code)) {
return console.warn(message.message);
}
}