-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild_hooks.ts
36 lines (29 loc) · 974 Bytes
/
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
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'
};
export function jestConfig(config): void {
if (!config.moduleNameMapper) {
config.moduleNameMapper = {};
}
config.moduleNameMapper['(.*)'] = '<rootDir>/src/$1';
}
export function tsconfig(config) {
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;