This repository was archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrollup.config.js
More file actions
76 lines (67 loc) · 2.05 KB
/
Copy pathrollup.config.js
File metadata and controls
76 lines (67 loc) · 2.05 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import replace from 'rollup-plugin-replace';
import sourcemaps from 'rollup-plugin-sourcemaps';
const globals = {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/platform-browser': 'ng.platformBrowser',
'@angular/router': 'ng.router',
'@angular/common/http': 'ng.common.http',
'@angular/forms': 'ng.forms',
'ng-zorro-antd': 'ngZorro.antd',
'ng-zorro-antd-extra': 'ngZorro.antd_extra',
'file-saver': 'saveAs',
'ngx-countdown': 'ngxCountDown',
'rxjs': 'Rx',
'rxjs/operators': 'Rx.Observable.prototype',
'date-fns/format': 'date-fns/format/index',
'date-fns/parse': 'date-fns/parse/index',
'date-fns/add_seconds': 'date-fns/add_seconds/index',
'date-fns/add_weeks': 'date-fns/add_weeks/index',
'date-fns/start_of_week': 'date-fns/start_of_week/index',
'date-fns/end_of_week': 'date-fns/end_of_week/index',
'date-fns/sub_weeks': 'date-fns/sub_weeks/index',
'date-fns/start_of_month': 'date-fns/start_of_month/index',
'date-fns/end_of_month': 'date-fns/end_of_month/index',
'date-fns/sub_months': 'date-fns/sub_months/index',
'date-fns/start_of_year': 'date-fns/start_of_year/index',
'date-fns/end_of_year': 'date-fns/end_of_year/index',
'date-fns/sub_years': 'date-fns/sub_years/index',
'date-fns/add_days': 'date-fns/add_days/index',
'date-fns/distance_in_words_to_now': 'date-fns/distance_in_words_to_now/index',
'extend': 'extend',
}
const listOfDateFns = [
'format',
'parse',
'addSeconds',
'addWeeks',
'startOfWeek',
'endOfWeek',
'subWeeks',
'startOfMonth',
'endOfMonth',
'subMonths',
'startOfYear',
'endOfYear',
'subYears',
'addDays',
];
const listOfReplace = listOfDateFns.map(name => {
const map = {};
map[`import * as ${name}`] = `import ${name}`;
return replace(map);
});
const plugins = [sourcemaps(), ...listOfReplace];
module.exports = {
plugins,
input: 'dist/index.js',
dest: 'dist/bundles/yoyo-ng-module.umd.js',
format: 'umd',
external: Object.keys(globals),
output: {
exports: 'named',
name: 'ng.yoyoModule',
sourcemap: true,
globals,
},
};