@@ -7,7 +7,6 @@ load("@npm//:html-insert-assets/package_json.bzl", html_insert_assets_bin = "bin
77load ("@npm//:karma/package_json.bzl" , _karma_bin = "bin" )
88load ("//tools:ng.bzl" , "ng_esbuild" , "ng_project" )
99load ("//tools:ts.bzl" , "ts_project" )
10- load ("//tools:sass.bzl" , "sass" )
1110load ("//tools:karma.bzl" , "generate_karma_config" , "generate_test_bootstrap" , "generate_test_setup" )
1211
1312# Common dependencies of Angular applications
@@ -224,7 +223,7 @@ def _pkg_web(name, entry_point, entry_deps, html_assets, assets, production, vis
224223 visibility = visibility ,
225224 )
226225
227- def ng_pkg (name , deps = [], test_deps = [], visibility = ["//visibility:public" ]):
226+ def ng_pkg (name , srcs = [], deps = [], test_deps = [], visibility = ["//visibility:public" ]):
228227 """
229228 Bazel macro for compiling an npm-like Angular package project. Creates '{name}' and 'test' targets.
230229
@@ -239,27 +238,19 @@ def ng_pkg(name, deps = [], test_deps = [], visibility = ["//visibility:public"]
239238
240239 Args:
241240 name: the rule name
241+ srcs: source files, if not set then we use **/*.{css,html,ts}
242242 deps: package dependencies
243243 test_deps: additional dependencies for tests
244244 visibility: visibility of the primary targets ('{name}', 'test')
245245 """
246246
247247 test_spec_srcs = native .glob (["src/**/*.spec.ts" ])
248248
249- srcs = native .glob (
249+ srcs = srcs or native .glob (
250250 ["src/**/*.ts" , "src/**/*.css" , "src/**/*.html" ],
251251 exclude = test_spec_srcs ,
252252 )
253253
254- sass_srcs = native .glob (["src/**/*.scss" ])
255- if len (sass_srcs ) > 0 :
256- sass (
257- name = "_sass" ,
258- srcs = sass_srcs ,
259- visibility = ["//visibility:private" ],
260- )
261- srcs = srcs + [":_sass" ]
262-
263254 # An index file to allow direct imports of the directory similar to a package.json "main"
264255 write_file (
265256 name = "_index" ,
0 commit comments