1 | import resolve from 'rollup-plugin-local-resolve';
|
2 | import sourcemaps from 'rollup-plugin-sourcemaps';
|
3 |
|
4 | const globals = {
|
5 |
|
6 | 'apollo-client': 'apollo.core',
|
7 | 'apollo-cache': 'apolloCache.core',
|
8 | 'apollo-link': 'apolloLink.core',
|
9 | 'apollo-utilities': 'apollo.utilities',
|
10 |
|
11 | 'graphql-anywhere/lib/async': 'graphqlAnywhere.async',
|
12 | };
|
13 |
|
14 | export default {
|
15 | input: 'lib/index.js',
|
16 | output: {
|
17 | file: 'lib/bundle.umd.js',
|
18 | format: 'umd',
|
19 | name: 'apolloLink.state',
|
20 | exports: 'named',
|
21 | sourcemap: true,
|
22 | globals,
|
23 | },
|
24 | external: Object.keys(globals),
|
25 | onwarn,
|
26 | plugins: [resolve(), sourcemaps()],
|
27 | };
|
28 |
|
29 | function onwarn(message) {
|
30 | const suppressed = ['UNRESOLVED_IMPORT', 'THIS_IS_UNDEFINED'];
|
31 |
|
32 | if (!suppressed.find(code => message.code === code)) {
|
33 | return console.warn(message.message);
|
34 | }
|
35 | }
|