-
Notifications
You must be signed in to change notification settings - Fork 263
/
rollup-node-tests.config.js
54 lines (50 loc) · 1.07 KB
/
rollup-node-tests.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import graphqlCompiler from 'rollup-plugin-graphql-js-client-compiler';
import nodeResolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import remap from 'rollup-plugin-remap';
import baseConfig from './rollup-tests-common.config';
baseConfig.plugins.unshift(
graphqlCompiler({
schema: './schema.json',
optimize: true,
profileDocuments: ['src/graphql/**/*.graphql']
})
);
baseConfig.plugins.push(
remap({
originalPath: './test/isomorphic-fetch-mock.js',
targetPath: './test/fetch-mock-node.js'
}),
nodeResolve({
jsnext: true,
main: true,
preferBuiltins: true
}),
babel({
babelrc: false,
presets: [
[`${process.cwd()}/node_modules/babel-preset-env/lib/index`, {
targets: {
node: '8.1.2'
},
modules: false
}]
]
})
);
baseConfig.targets = [{
format: 'cjs',
dest: '.tmp/test/node-tests.js'
}];
baseConfig.external = [
'assert',
'url',
'http',
'https',
'zlib',
'stream',
'buffer',
'util',
'string_decoder'
];
export default baseConfig;