This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathrollup.module.js
56 lines (52 loc) · 2.01 KB
/
rollup.module.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import resolve from 'rollup-plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import pkg from './package.json';
export default [
// browser-friendly UMD build
{
input: 'src/index.ts',
output: {
name: 'graphql-genie',
file: pkg.module,
format: 'cjs',
globals: {
'graphql': 'graphql_1',
'lodash': 'lodash',
'fortune': 'fortune',
'graphql-tools': 'graphql-tools',
'graphql-subscriptions': 'graphql-subscriptions'
}
},
onwarn,
plugins: [
resolve({
extensions: ['.mjs', '.js', '.json'],
preferBuiltins: true,
jsnext: true,
main: true,
browser: false
}), // so Rollup can find `ms`
commonjs({
include: ['node_modules/**'],
sourceMap: false,
namedExports: {
'node_modules/lodash/lodash.js': ['isFunction', 'camelCase', 'values', 'find', 'eq', 'difference', 'union', 'uniq', 'pick', 'isDate', 'startsWith', 'includes', 'omitBy', 'omit', 'set', 'has', 'isString', 'isNumber', 'isEqual', 'findIndex', 'concat', 'forOwn', 'keyBy', 'assign', 'each', 'get', 'merge', 'pickBy', 'endsWith', 'isEmpty', 'isArray', 'isObject', 'map', 'keys', 'mapKeys', 'mapValues'],
'node_modules/graphql-tools/dist/index.js': [ 'SchemaDirectiveVisitor', 'makeExecutableSchema', 'addResolveFunctionsToSchema' ],
'node_modules/graphql-type-json/lib/index.js': ['GraphQLJSON'],
'node_modules/graphql-iso-date/dist/index.js': ['GraphQLDate', 'GraphQLTime', 'GraphQLDateTime']
}
}), // so Rollup can convert `ms` to an ES module
typescript(),
json()
],
external: ['graphql-subscriptions', 'graphql-tools', 'fortune', 'fortune/lib/adapter/adapters/common', 'lodash', 'graphql', 'graphql/language', 'graphql/execution/values', 'graphql/language/printer', 'graphql/error']
}
];
function onwarn(message) {
const suppressed = ['THIS_IS_UNDEFINED'];
if (!suppressed.find(code => message.code === code)) {
return console.warn(message.message);
}
}