forked from the-guild-org/apollo-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
39 lines (35 loc) · 946 Bytes
/
rollup.config.js
File metadata and controls
39 lines (35 loc) · 946 Bytes
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
const genName = name => `apollo.${name}`;
export const globals = {
// Angular
'@angular/core': 'ng.core',
'@angular/common/http': 'ng.common.http',
'@ngrx/store': 'ngrx.store',
// Apollo
'apollo-link': 'apolloLink.core',
'apollo-client': 'apollo',
'apollo-angular-link-http-common': genName('link.httpCommon'),
'apollo-link-context': 'apolloLink.context',
'apollo-link-persisted-queries': 'persistedQueryLink',
// RxJS
rxjs: 'rxjs',
'rxjs/operators': 'rxjs.operators',
};
export default name => ({
input: 'build/src/index.js',
output: {
file: 'build/bundle.umd.js',
format: 'umd',
},
name: genName(name),
exports: 'named',
sourcemap: true,
external: Object.keys(globals),
onwarn,
globals,
});
function onwarn(message) {
const suppressed = ['UNRESOLVED_IMPORT', 'THIS_IS_UNDEFINED'];
if (!suppressed.find(code => message.code === code)) {
return console.warn(message.message);
}
}