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