UNPKG

881 BJavaScriptView Raw
1import sourcemaps from 'rollup-plugin-sourcemaps';
2import resolve from 'rollup-plugin-node-resolve';
3
4function onwarn(message) {
5 const suppressed = ['UNRESOLVED_IMPORT', 'THIS_IS_UNDEFINED'];
6
7 if (!suppressed.find(code => message.code === code)) {
8 return console.warn(message.message);
9 }
10}
11
12const globals = {
13 'graphql-anywhere/lib/async': 'graphqlAnywhere.async',
14 'graphql/language/printer': 'print',
15 'symbol-observable': '$$observable',
16 'zen-observable': 'zenObservable',
17 'fast-json-stable-stringify': 'stringify',
18 'graphql-tag': 'gql',
19 'apollo-utilities': 'apolloUtilities',
20};
21
22export default {
23 input: 'lib/index.js',
24 onwarn,
25 output: {
26 file: 'lib/bundle.umd.js',
27 format: 'umd',
28 sourcemap: true,
29 name: 'apollo.boost',
30 globals,
31 exports: 'named',
32 },
33 external: Object.keys(globals),
34 plugins: [resolve(), sourcemaps()],
35};