@@ -8,24 +8,42 @@ VERSION_PLACEHOLDER_REPLACEMENTS = {
8
8
"0.0.0-NG" : ANGULAR_PACKAGE_VERSION ,
9
9
}
10
10
11
- # UMD bundles for Angular packages and subpackages we depend on for development and testing.
12
- ANGULAR_LIBRARY_UMDS = [
13
- "@npm//:node_modules/@angular/animations/bundles/animations-browser.umd.js" ,
14
- "@npm//:node_modules/@angular/animations/bundles/animations.umd.js" ,
15
- "@npm//:node_modules/@angular/common/bundles/common-http-testing.umd.js" ,
16
- "@npm//:node_modules/@angular/common/bundles/common-http.umd.js" ,
17
- "@npm//:node_modules/@angular/common/bundles/common-testing.umd.js" ,
18
- "@npm//:node_modules/@angular/common/bundles/common.umd.js" ,
19
- "@npm//:node_modules/@angular/compiler/bundles/compiler-testing.umd.js" ,
11
+ # List of default Angular library UMD bundles which are not processed by ngcc.
12
+ ANGULAR_NO_NGCC_BUNDLES = [
20
13
"@npm//:node_modules/@angular/compiler/bundles/compiler.umd.js" ,
21
- "@npm//:node_modules/@angular/core/bundles/core-testing.umd.js" ,
22
- "@npm//:node_modules/@angular/core/bundles/core.umd.js" ,
23
- "@npm//:node_modules/@angular/elements/bundles/elements.umd.js" ,
24
- "@npm//:node_modules/@angular/forms/bundles/forms.umd.js" ,
25
- "@npm//:node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js" ,
26
- "@npm//:node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js" ,
27
- "@npm//:node_modules/@angular/platform-browser/bundles/platform-browser-animations.umd.js" ,
28
- "@npm//:node_modules/@angular/platform-browser/bundles/platform-browser-testing.umd.js" ,
29
- "@npm//:node_modules/@angular/platform-browser/bundles/platform-browser.umd.js" ,
30
- "@npm//:node_modules/@angular/router/bundles/router.umd.js" ,
31
14
]
15
+
16
+ # List of Angular library UMD bundles which will are processed by ngcc.
17
+ ANGULAR_NGCC_BUNDLES = [
18
+ ("@angular/animations" , ["animations-browser.umd.js" , "animations.umd.js" ]),
19
+ ("@angular/common" , ["common-http-testing.umd.js" , "common-http.umd.js" , "common-testing.umd.js" , "common.umd.js" ]),
20
+ ("@angular/compiler" , ["compiler-testing.umd.js" ]),
21
+ ("@angular/core" , ["core-testing.umd.js" , "core.umd.js" ]),
22
+ ("@angular/elements" , ["elements.umd.js" ]),
23
+ ("@angular/forms" , ["forms.umd.js" ]),
24
+ ("@angular/platform-browser-dynamic" , ["platform-browser-dynamic-testing.umd.js" , "platform-browser-dynamic.umd.js" ]),
25
+ ("@angular/platform-browser" , ["platform-browser.umd.js" , "platform-browser-testing.umd.js" , "platform-browser-animations.umd.js" ]),
26
+ ("@angular/router" , ["router.umd.js" ]),
27
+ ]
28
+
29
+ ANGULAR_LIBRARY_VIEW_ENGINE_UMDS = ANGULAR_NO_NGCC_BUNDLES + [
30
+ "@npm//:node_modules/%s/bundles/%s" % (pkgName , bundleName )
31
+ for pkgName , bundleNames in ANGULAR_NGCC_BUNDLES
32
+ for bundleName in bundleNames
33
+ ]
34
+ ANGULAR_LIBRARY_IVY_UMDS = ANGULAR_NO_NGCC_BUNDLES + [
35
+ "@npm//:node_modules/%s/__ivy_ngcc__/bundles/%s" % (pkgName , bundleName )
36
+ for pkgName , bundleNames in ANGULAR_NGCC_BUNDLES
37
+ for bundleName in bundleNames
38
+ ]
39
+
40
+ """
41
+ Gets the list of targets for the Angular library UMD bundles. Conditionally
42
+ switches between View Engine or Ivy UMD bundles based on the "--define=compile" flag.
43
+ """
44
+
45
+ def getAngularUmdTargets ():
46
+ return select ({
47
+ "//tools:view_engine_mode" : ANGULAR_LIBRARY_VIEW_ENGINE_UMDS ,
48
+ "//conditions:default" : ANGULAR_LIBRARY_IVY_UMDS ,
49
+ })
0 commit comments