-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
339 lines (333 loc) · 18 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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
import resolve from 'rollup-plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
import nodeResolve from 'rollup-plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps';
import CleanCSS from 'clean-css';
import { minify as minifyHtml } from 'html-minifier';
import angular from 'rollup-plugin-angular';
import sass from 'node-sass';
/**
* Add here external dependencies that actually you use.
*
* About RxJS
* Each RxJS functionality that you use in the library must be added as external dependency.
* - For main classes use 'Rx':
* e.g. import { Observable } from 'rxjs/Observable'; => 'rxjs/Observable': 'Rx'
* - For observable methods use 'Rx.Observable':
* e.g. import 'rxjs/add/observable/merge'; => 'rxjs/add/observable/merge': 'Rx.Observable'
* or for lettable operators:
* e.g. import { merge } from 'rxjs/observable/merge'; => 'rxjs/observable/merge': 'Rx.Observable'
* - For operators use 'Rx.Observable.prototype':
* e.g. import 'rxjs/add/operator/map'; => 'rxjs/add/operator/map': 'Rx.Observable.prototype'
* or for lettable operators:
* e.g. import { map } from 'rxjs/operators'; => 'rxjs/operators': 'Rx.Observable.prototype'
*/
const globals = {
'@x/theme': 'ng.xTheme',
'@criollapp/components': 'ng.caComponents',
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/animations': 'ng.animations',
'@angular/forms': 'ng.forms',
'@angular/http': 'ng.http',
'@angular/platform-browser': 'ng.platformBrowser',
'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',
'@angular/platform-browser/animations': 'ng.platformBrowser.animations',
'@angular/router': 'ng.router',
'rxjs/AnonymousSubject': 'Rx',
'rxjs/AsyncSubject': 'Rx',
'rxjs/BehaviorSubject': 'Rx',
'rxjs/Notifiction': 'Rx',
'rxjs/ObservableInput': 'Rx',
'rxjs/Observable': 'Rx',
'rxjs/Observer': 'Rx',
'rxjs/ReplaySubject': 'Rx',
'rxjs/Scheduler': 'Rx',
'rxjs/Subject': 'Rx',
'rxjs/SubjectSubscriber': 'Rx',
'rxjs/SubscribableOrPromise': 'Rx',
'rxjs/Subscriber': 'Rx',
'rxjs/Subscription': 'Rx',
'rxjs/TeardownLogic': 'Rx',
'rxjs/add/observable/bindCallback': 'Rx.Observable',
'rxjs/add/observable/bindNodeCallback': 'Rx.Observable',
'rxjs/add/observable/combineLatest': 'Rx.Observable',
'rxjs/add/observable/concat': 'Rx.Observable',
'rxjs/add/observable/create': 'Rx.Observable',
'rxjs/add/observable/defer': 'Rx.Observable',
'rxjs/add/observable/empty': 'Rx.Observable',
'rxjs/add/observable/forkJoin': 'Rx.Observable',
'rxjs/add/observable/from': 'Rx.Observable',
'rxjs/add/observable/fromEvent': 'Rx.Observable',
'rxjs/add/observable/fromEventPattern': 'Rx.Observable',
'rxjs/add/observable/fromPromise': 'Rx.Observable',
'rxjs/add/observable/interval': 'Rx.Observable',
'rxjs/add/observable/merge': 'Rx.Observable',
'rxjs/add/observable/never': 'Rx.Observable',
'rxjs/add/observable/of': 'Rx.Observable',
'rxjs/add/observable/range': 'Rx.Observable',
'rxjs/add/observable/throw': 'Rx.Observable',
'rxjs/add/observable/timer': 'Rx.Observable',
'rxjs/add/observable/webSocket': 'Rx.Observable',
'rxjs/add/observable/zip': 'Rx.Observable',
'rxjs/add/operator/audit': 'Rx.Observable.prototype',
'rxjs/add/operator/auditTime': 'Rx.Observable.prototype',
'rxjs/add/operator/buffer': 'Rx.Observable.prototype',
'rxjs/add/operator/bufferCount': 'Rx.Observable.prototype',
'rxjs/add/operator/bufferTime': 'Rx.Observable.prototype',
'rxjs/add/operator/bufferToggle': 'Rx.Observable.prototype',
'rxjs/add/operator/bufferWhen': 'Rx.Observable.prototype',
'rxjs/add/operator/catch': 'Rx.Observable.prototype',
'rxjs/add/operator/combineAll': 'Rx.Observable.prototype',
'rxjs/add/operator/combineLatest': 'Rx.Observable.prototype',
'rxjs/add/operator/concat': 'Rx.Observable.prototype',
'rxjs/add/operator/concatAll': 'Rx.Observable.prototype',
'rxjs/add/operator/concatMap': 'Rx.Observable.prototype',
'rxjs/add/operator/concatMapTo': 'Rx.Observable.prototype',
'rxjs/add/operator/count': 'Rx.Observable.prototype',
'rxjs/add/operator/debounce': 'Rx.Observable.prototype',
'rxjs/add/operator/debounceTime': 'Rx.Observable.prototype',
'rxjs/add/operator/defaultIfEmpty': 'Rx.Observable.prototype',
'rxjs/add/operator/delay': 'Rx.Observable.prototype',
'rxjs/add/operator/delayWhen': 'Rx.Observable.prototype',
'rxjs/add/operator/dematerialize': 'Rx.Observable.prototype',
'rxjs/add/operator/distinct': 'Rx.Observable.prototype',
'rxjs/add/operator/distinctUntilChanged': 'Rx.Observable.prototype',
'rxjs/add/operator/distinctUntilKeyChanged': 'Rx.Observable.prototype',
'rxjs/add/operator/do': 'Rx.Observable.prototype',
'rxjs/add/operator/elementAt': 'Rx.Observable.prototype',
'rxjs/add/operator/every': 'Rx.Observable.prototype',
'rxjs/add/operator/exhaust': 'Rx.Observable.prototype',
'rxjs/add/operator/exhaustMap': 'Rx.Observable.prototype',
'rxjs/add/operator/expand': 'Rx.Observable.prototype',
'rxjs/add/operator/filter': 'Rx.Observable.prototype',
'rxjs/add/operator/finally': 'Rx.Observable.prototype',
'rxjs/add/operator/find': 'Rx.Observable.prototype',
'rxjs/add/operator/findIndex': 'Rx.Observable.prototype',
'rxjs/add/operator/first': 'Rx.Observable.prototype',
'rxjs/add/operator/forEach': 'Rx.Observable.prototype',
'rxjs/add/operator/groupBy': 'Rx.Observable.prototype',
'rxjs/add/operator/ignoreElements': 'Rx.Observable.prototype',
'rxjs/add/operator/isEmpty': 'Rx.Observable.prototype',
'rxjs/add/operator/last': 'Rx.Observable.prototype',
'rxjs/add/operator/letProto': 'Rx.Observable.prototype',
'rxjs/add/operator/lift': 'Rx.Observable.prototype',
'rxjs/add/operator/map': 'Rx.Observable.prototype',
'rxjs/add/operator/materialize': 'Rx.Observable.prototype',
'rxjs/add/operator/max': 'Rx.Observable.prototype',
'rxjs/add/operator/merge': 'Rx.Observable.prototype',
'rxjs/add/operator/mergeAll': 'Rx.Observable.prototype',
'rxjs/add/operator/mergeMap': 'Rx.Observable.prototype',
'rxjs/add/operator/mergeMapTo': 'Rx.Observable.prototype',
'rxjs/add/operator/mergeScan': 'Rx.Observable.prototype',
'rxjs/add/operator/min': 'Rx.Observable.prototype',
'rxjs/add/operator/multicast': 'Rx.Observable.prototype',
'rxjs/add/operator/observeOn': 'Rx.Observable.prototype',
'rxjs/add/operator/pairwise': 'Rx.Observable.prototype',
'rxjs/add/operator/partition': 'Rx.Observable.prototype',
'rxjs/add/operator/pluck': 'Rx.Observable.prototype',
'rxjs/add/operator/publish': 'Rx.Observable.prototype',
'rxjs/add/operator/publishBehavior':'Rx.Observable.prototype',
'rxjs/add/operator/publishLast': 'Rx.Observable.prototype',
'rxjs/add/operator/publishReplay': 'Rx.Observable.prototype',
'rxjs/add/operator/race': 'Rx.Observable.prototype',
'rxjs/add/operator/reduce': 'Rx.Observable.prototype',
'rxjs/add/operator/repeat': 'Rx.Observable.prototype',
'rxjs/add/operator/repeatWhen': 'Rx.Observable.prototype',
'rxjs/add/operator/retry': 'Rx.Observable.prototype',
'rxjs/add/operator/retryWhen': 'Rx.Observable.prototype',
'rxjs/add/operator/sample': 'Rx.Observable.prototype',
'rxjs/add/operator/sampleTime': 'Rx.Observable.prototype',
'rxjs/add/operator/scan': 'Rx.Observable.prototype',
'rxjs/add/operator/sequenceEqual': 'Rx.Observable.prototype',
'rxjs/add/operator/share': 'Rx.Observable.prototype',
'rxjs/add/operator/single': 'Rx.Observable.prototype',
'rxjs/add/operator/skip': 'Rx.Observable.prototype',
'rxjs/add/operator/skipUntil': 'Rx.Observable.prototype',
'rxjs/add/operator/skipWhile': 'Rx.Observable.prototype',
'rxjs/add/operator/startWith': 'Rx.Observable.prototype',
'rxjs/add/operator/subscribeOn': 'Rx.Observable.prototype',
'rxjs/add/operator/switch': 'Rx.Observable.prototype',
'rxjs/add/operator/switchMap': 'Rx.Observable.prototype',
'rxjs/add/operator/switchMapTo': 'Rx.Observable.prototype',
'rxjs/add/operator/take': 'Rx.Observable.prototype',
'rxjs/add/operator/takeLast': 'Rx.Observable.prototype',
'rxjs/add/operator/takeUntil': 'Rx.Observable.prototype',
'rxjs/add/operator/takeWhile': 'Rx.Observable.prototype',
'rxjs/add/operator/throttle': 'Rx.Observable.prototype',
'rxjs/add/operator/throttleTime': 'Rx.Observable.prototype',
'rxjs/add/operator/timeInterval': 'Rx.Observable.prototype',
'rxjs/add/operator/timeout': 'Rx.Observable.prototype',
'rxjs/add/operator/timeoutWith': 'Rx.Observable.prototype',
'rxjs/add/operator/timestamp': 'Rx.Observable.prototype',
'rxjs/add/operator/toArray': 'Rx.Observable.prototype',
'rxjs/add/operator/toPromise': 'Rx.Observable.prototype',
'rxjs/add/operator/window': 'Rx.Observable.prototype',
'rxjs/add/operator/windowCount': 'Rx.Observable.prototype',
'rxjs/add/operator/windowToggle': 'Rx.Observable.prototype',
'rxjs/add/operator/windowWhen': 'Rx.Observable.prototype',
'rxjs/add/operator/withLatestFrom': 'Rx.Observable.prototype',
'rxjs/add/operator/zipAll': 'Rx.Observable.prototype',
'rxjs/add/operator/zipProto': 'Rx.Observable.prototype',
'rxjs/observable/bindCallback': 'Rx.Observable',
'rxjs/observable/bindNodeCallback': 'Rx.Observable',
'rxjs/observable/combineLatest': 'Rx.Observable',
'rxjs/observable/concat': 'Rx.Observable',
'rxjs/observable/defer': 'Rx.Observable',
'rxjs/observable/empty': 'Rx.Observable',
'rxjs/observable/forkJoin': 'Rx.Observable',
'rxjs/observable/from': 'Rx.Observable',
'rxjs/observable/fromEvent': 'Rx.Observable',
'rxjs/observable/fromEventPattern': 'Rx.Observable',
'rxjs/observable/fromPromise': 'Rx.Observable',
'rxjs/observable/if': 'Rx.Observable',
'rxjs/observable/interval': 'Rx.Observable',
'rxjs/observable/merge': 'Rx.Observable',
'rxjs/observable/never': 'Rx.Observable',
'rxjs/observable/of': 'Rx.Observable',
'rxjs/observable/pairs': 'Rx.Observable',
'rxjs/observable/range': 'Rx.Observable',
'rxjs/observable/throw': 'Rx.Observable',
'rxjs/observable/timer': 'Rx.Observable',
'rxjs/observable/using': 'Rx.Observable',
'rxjs/observable/zip': 'Rx.Observable',
'rxjs/operator/audit': 'Rx.Observable.prototype',
'rxjs/operator/auditTime': 'Rx.Observable.prototype',
'rxjs/operator/buffer': 'Rx.Observable.prototype',
'rxjs/operator/bufferCount': 'Rx.Observable.prototype',
'rxjs/operator/bufferTime': 'Rx.Observable.prototype',
'rxjs/operator/bufferToggle': 'Rx.Observable.prototype',
'rxjs/operator/bufferWhen': 'Rx.Observable.prototype',
'rxjs/operator/catch': 'Rx.Observable.prototype',
'rxjs/operator/combineAll': 'Rx.Observable.prototype',
'rxjs/operator/combineLatest': 'Rx.Observable.prototype',
'rxjs/operator/concat': 'Rx.Observable.prototype',
'rxjs/operator/concatAll': 'Rx.Observable.prototype',
'rxjs/operator/concatMap': 'Rx.Observable.prototype',
'rxjs/operator/concatMapTo': 'Rx.Observable.prototype',
'rxjs/operator/count': 'Rx.Observable.prototype',
'rxjs/operator/debounce': 'Rx.Observable.prototype',
'rxjs/operator/debounceTime': 'Rx.Observable.prototype',
'rxjs/operator/defaultIfEmpty': 'Rx.Observable.prototype',
'rxjs/operator/delay': 'Rx.Observable.prototype',
'rxjs/operator/delayWhen': 'Rx.Observable.prototype',
'rxjs/operator/dematerialize': 'Rx.Observable.prototype',
'rxjs/operator/distinct': 'Rx.Observable.prototype',
'rxjs/operator/distinctUntilChanged': 'Rx.Observable.prototype',
'rxjs/operator/distinctUntilKeyChanged': 'Rx.Observable.prototype',
'rxjs/operator/do': 'Rx.Observable.prototype',
'rxjs/operator/elementAt': 'Rx.Observable.prototype',
'rxjs/operator/every': 'Rx.Observable.prototype',
'rxjs/operator/exhaust': 'Rx.Observable.prototype',
'rxjs/operator/exhaustMap': 'Rx.Observable.prototype',
'rxjs/operator/expand': 'Rx.Observable.prototype',
'rxjs/operator/filter': 'Rx.Observable.prototype',
'rxjs/operator/finally': 'Rx.Observable.prototype',
'rxjs/operator/find': 'Rx.Observable.prototype',
'rxjs/operator/findIndex': 'Rx.Observable.prototype',
'rxjs/operator/first': 'Rx.Observable.prototype',
'rxjs/operator/forEach': 'Rx.Observable.prototype',
'rxjs/operator/groupBy': 'Rx.Observable.prototype',
'rxjs/operator/ignoreElements': 'Rx.Observable.prototype',
'rxjs/operator/isEmpty': 'Rx.Observable.prototype',
'rxjs/operator/last': 'Rx.Observable.prototype',
'rxjs/operator/letProto': 'Rx.Observable.prototype',
'rxjs/operator/lift': 'Rx.Observable.prototype',
'rxjs/operator/map': 'Rx.Observable.prototype',
'rxjs/operator/materialize': 'Rx.Observable.prototype',
'rxjs/operator/max': 'Rx.Observable.prototype',
'rxjs/operator/merge': 'Rx.Observable.prototype',
'rxjs/operator/mergeAll': 'Rx.Observable.prototype',
'rxjs/operator/mergeMap': 'Rx.Observable.prototype',
'rxjs/operator/mergeMapTo': 'Rx.Observable.prototype',
'rxjs/operator/mergeScan': 'Rx.Observable.prototype',
'rxjs/operator/min': 'Rx.Observable.prototype',
'rxjs/operator/multicast': 'Rx.Observable.prototype',
'rxjs/operator/observeOn': 'Rx.Observable.prototype',
'rxjs/operator/pairwise': 'Rx.Observable.prototype',
'rxjs/operator/partition': 'Rx.Observable.prototype',
'rxjs/operator/pluck': 'Rx.Observable.prototype',
'rxjs/operator/publish': 'Rx.Observable.prototype',
'rxjs/operator/publishBehavior':'Rx.Observable.prototype',
'rxjs/operator/publishLast': 'Rx.Observable.prototype',
'rxjs/operator/publishReplay': 'Rx.Observable.prototype',
'rxjs/operator/race': 'Rx.Observable.prototype',
'rxjs/operator/reduce': 'Rx.Observable.prototype',
'rxjs/operator/repeat': 'Rx.Observable.prototype',
'rxjs/operator/repeatWhen': 'Rx.Observable.prototype',
'rxjs/operator/retry': 'Rx.Observable.prototype',
'rxjs/operator/retryWhen': 'Rx.Observable.prototype',
'rxjs/operator/sample': 'Rx.Observable.prototype',
'rxjs/operator/sampleTime': 'Rx.Observable.prototype',
'rxjs/operator/scan': 'Rx.Observable.prototype',
'rxjs/operator/sequenceEqual': 'Rx.Observable.prototype',
'rxjs/operator/share': 'Rx.Observable.prototype',
'rxjs/operator/single': 'Rx.Observable.prototype',
'rxjs/operator/skip': 'Rx.Observable.prototype',
'rxjs/operator/skipUntil': 'Rx.Observable.prototype',
'rxjs/operator/skipWhile': 'Rx.Observable.prototype',
'rxjs/operator/startWith': 'Rx.Observable.prototype',
'rxjs/operator/subscribeOn': 'Rx.Observable.prototype',
'rxjs/operator/switch': 'Rx.Observable.prototype',
'rxjs/operator/switchMap': 'Rx.Observable.prototype',
'rxjs/operator/switchMapTo': 'Rx.Observable.prototype',
'rxjs/operator/take': 'Rx.Observable.prototype',
'rxjs/operator/takeLast': 'Rx.Observable.prototype',
'rxjs/operator/takeUntil': 'Rx.Observable.prototype',
'rxjs/operator/takeWhile': 'Rx.Observable.prototype',
'rxjs/operator/throttle': 'Rx.Observable.prototype',
'rxjs/operator/throttleTime': 'Rx.Observable.prototype',
'rxjs/operator/timeInterval': 'Rx.Observable.prototype',
'rxjs/operator/timeout': 'Rx.Observable.prototype',
'rxjs/operator/timeoutWith': 'Rx.Observable.prototype',
'rxjs/operator/timestamp': 'Rx.Observable.prototype',
'rxjs/operator/toArray': 'Rx.Observable.prototype',
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
'rxjs/operator/window': 'Rx.Observable.prototype',
'rxjs/operator/windowCount': 'Rx.Observable.prototype',
'rxjs/operator/windowToggle': 'Rx.Observable.prototype',
'rxjs/operator/windowWhen': 'Rx.Observable.prototype',
'rxjs/operator/withLatestFrom': 'Rx.Observable.prototype',
'rxjs/operator/zipAll': 'Rx.Observable.prototype',
'rxjs/operator/zipProto': 'Rx.Observable.prototype',
'rxjs/symbol/iterator': 'Rx.Symbol',
'rxjs/symbol/observable': 'Rx.Symbol',
'rxjs/symbol/rxSubscriber': 'Rx.Symbol',
};
const cssmin = new CleanCSS();
const htmlminOpts = {
caseSensitive: true,
collapseWhitespace: true,
removeComments: true,
};
export default {
input: 'public_api.ts',
output: {
format: 'umd',
file: 'bundles/ca-common.umd.js'
},
external: Object.keys(globals),
plugins: [resolve(), sourcemaps(),
angular({
// additional replace `templateUrl` and `stylesUrls` in every `.js` file
// default: true
replace: false,
preprocessors: {
template: template => minifyHtml(template, htmlminOpts),
style: scss => {
const css = sass.renderSync({ data: scss }).css;
return cssmin.minify(css).styles;
}
}
}),
typescript({ useTsconfigDeclarationDir: true }),
nodeResolve({ jsnext: true, main: true })],
onwarn: () => { return },
output: {
format: 'umd',
name: 'ng.caCommon',
globals: globals,
sourcemap: true,
exports: 'named'
}
}