forked from cipchk/g2-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
48 lines (42 loc) · 1.19 KB
/
rollup.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
import resolve from "rollup-plugin-node-resolve";
import uglify from "rollup-plugin-uglify";
import sourcemaps from "rollup-plugin-sourcemaps";
const target = process.env.ROLLUP_TARGET || "esm";
let globals = {
"@angular/animations": "ng.animations",
"@angular/core": "ng.core",
"@angular/common": "ng.common",
"@angular/forms": "ng.forms",
"@angular/common/http": "ng.common.http",
"@angular/router": "ng.router",
"@angular/platform-browser": "ng.platformBrowser",
"@angular/platform-server": "ng.platformServer",
"@angular/platform-browser-dynamic": "ng.platformBrowserDynamic",
"@angular/platform-browser/animations": "ng.platformBrowser.animations",
"@angular/core/testing": "ng.core.testing",
"@angular/common/testing": "ng.common.testing",
"@angular/common/http/testing": "ng.common.http.testing",
'rxjs': 'rxjs'
};
let plugins = [sourcemaps(), resolve()];
switch (target) {
case "esm":
Object.assign(globals, {
tslib: "tslib"
});
break;
case "mumd":
// @ts-ignore
plugins.push(uglify());
break;
}
export default {
exports: "named",
name: "ngxF2",
plugins,
external: Object.keys(globals),
globals,
output: {
sourcemap: true
}
};