forked from Crazyht/ngx-tree-select
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_hooks.ts
46 lines (39 loc) · 1.29 KB
/
build_hooks.ts
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
const globals = {
'tslib': 'tslib',
'@angular/animations': 'ng.animations',
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@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',
'@ng-bootstrap/ng-bootstrap': 'bootstrap',
'rxjs/Rx': 'Rx',
'rxjs/ReplaySubject': 'Rx.ReplaySubject',
'rxjs/BehaviorSubject': 'Rx.BehaviorSubject',
'rxjs/Subject': 'Rx.Subject',
'rxjs/Observable': 'Rx.Observable'
};
export function jestConfig(config): void {
if (!config.moduleNameMapper) {
config.moduleNameMapper = {};
}
config.moduleNameMapper['(.*)'] = '<rootDir>/src/$1';
}
export function tsconfig(config) {
if (!config.angularCompilerOptions) {
config.angularCompilerOptions = {};
}
config.angularCompilerOptions.strictMetadataEmit = false;
}
export function rollupFESM(config) {
if (config.external) {
config.external = config.external.concat(Object.keys(globals));
} else {
config.external = Object.keys(globals);
}
config.globals = Object.assign(config.globals || {}, globals);
}
export const rollupUMD = rollupFESM;