1- load ( "@bazel_skylib//rules:write_file.bzl" , "write_file" )
2- load ( "@aspect_rules_js//npm:defs.bzl" , "npm_package" )
1+ "Macros to make BUILD files more ergonomic."
2+
33load ("@aspect_bazel_lib//lib:copy_to_directory.bzl" , "copy_to_directory" )
44load ("@aspect_rules_esbuild//esbuild:defs.bzl" , "esbuild" )
5+ load ("@aspect_rules_js//npm:defs.bzl" , "npm_package" )
6+ load ("@bazel_skylib//rules:write_file.bzl" , "write_file" )
57load ("@npm//:history-server/package_json.bzl" , history_server_bin = "bin" )
68load ("@npm//:html-insert-assets/package_json.bzl" , html_insert_assets_bin = "bin" )
79load ("@npm//:karma/package_json.bzl" , _karma_bin = "bin" )
10+ load ("//tools:karma.bzl" , "generate_karma_config" , "generate_test_bootstrap" , "generate_test_setup" )
811load ("//tools:ng.bzl" , "ng_esbuild" , "ng_project" )
912load ("//tools:ts.bzl" , "ts_project" )
10- load ("//tools:karma.bzl" , "generate_karma_config" , "generate_test_bootstrap" , "generate_test_setup" )
1113
1214# Common dependencies of Angular applications
1315APPLICATION_DEPS = [
@@ -60,7 +62,7 @@ NG_PROD_DEFINE = {
6062 "ngJitMode" : "false" ,
6163}
6264
63- def ng_application (name , deps = [], test_deps = [], assets = None , html_assets = APPLICATION_HTML_ASSETS , visibility = ["//visibility:public" ], ** kwargs ):
65+ def ng_application (name , deps = [], test_deps = [], assets = None , html_assets = APPLICATION_HTML_ASSETS , visibility = ["//visibility:public" ]):
6466 """
6567 Bazel macro for compiling an Angular application. Creates {name}, test, serve targets.
6668
@@ -83,7 +85,6 @@ def ng_application(name, deps = [], test_deps = [], assets = None, html_assets =
8385 html_assets: assets to insert into the index.html, [styles.css, favicon.ico] by default
8486 assets: assets to include in the file bundle
8587 visibility: visibility of the primary targets ({name}, 'test', 'serve')
86- **kwargs: extra args passed to main Angular CLI rules
8788 """
8889 assets = assets if assets else native .glob (["assets/**/*" ])
8990 html_assets = html_assets if html_assets else []
@@ -246,7 +247,7 @@ def ng_pkg(name, srcs, deps = [], test_deps = [], visibility = ["//visibility:pu
246247 visibility: visibility of the primary targets ('{name}', 'test')
247248 """
248249
249- test_spec_srcs = native .glob (["src/**/*.spec.ts" ])
250+ test_spec_srcs = native .glob (["src/**/*.spec.ts" ], allow_empty = True )
250251
251252 # An index file to allow direct imports of the directory similar to a package.json "main"
252253 write_file (
0 commit comments