6
6
licenses (["notice" ]) # MIT
7
7
8
8
load ("//tools:defaults.bzl" , "ts_library" )
9
+ load ("@build_bazel_rules_nodejs//:defs.bzl" , "jasmine_node_test" )
9
10
10
11
package (default_visibility = ["//visibility:public" ])
11
12
12
13
ts_library (
13
- name = "lib " ,
14
+ name = "build_optimizer " ,
14
15
srcs = glob (
15
- ["**/*.ts" ],
16
- # Currently, this library is used only with the rollup plugin.
17
- # To make it simpler for downstream repositories to compile this, we
18
- # neither provide compile-time deps as an `npm_install` rule, nor do we
19
- # expect the downstream repository to install @types/webpack[-*]
20
- # So we exclude files that depend on webpack typings.
16
+ include = ["src/**/*.ts" ],
21
17
exclude = [
22
- "src/build-optimizer/webpack-loader.ts" ,
23
- "src/purify/**" ,
24
- "src/index.ts" ,
25
- "**/*_spec.ts" ,
26
- "**/*_spec_large.ts" ,
18
+ # TODO(@filipesilva): shouldn't need to exclude the cli files but can't exclude them
19
+ # from jasmine_node_test.
20
+ "src/**/cli.ts" ,
21
+ "src/**/*_spec.ts" ,
22
+ "src/**/*_spec_large.ts" ,
23
+ "src/**/*_benchmark.ts" ,
27
24
],
28
25
),
29
- # Borrow the compile-time deps of the typescript compiler
30
- # Just to avoid an extra npm install action.
31
- node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules" ,
32
- tsconfig = "//:tsconfig.json" ,
26
+ deps = [],
33
27
)
28
+
29
+ ts_library (
30
+ name = "build_optimizer_test_lib" ,
31
+ srcs = glob (
32
+ include = [
33
+ "src/**/*_spec.ts" ,
34
+ "src/**/*_spec_large.ts" ,
35
+ ],
36
+ ),
37
+ deps = [
38
+ ":build_optimizer" ,
39
+ "//packages/angular_devkit/core" ,
40
+ # @typings: jasmine
41
+ # @typings: node
42
+ ],
43
+ )
44
+
45
+ jasmine_node_test (
46
+ name = "build_optimizer_test" ,
47
+ srcs = [":build_optimizer_test_lib" ],
48
+ )
0 commit comments