@@ -6,17 +6,15 @@ load("@io_bazel_rules_sass//:defs.bzl", _npm_sass_library = "npm_sass_library",
66load ("@npm//@angular/bazel:index.bzl" , _ng_package = "ng_package" )
77load ("@npm//@angular/build-tooling/bazel/integration:index.bzl" , _integration_test = "integration_test" )
88load ("@npm//@angular/build-tooling/bazel/esbuild:index.bzl" , _esbuild = "esbuild" , _esbuild_config = "esbuild_config" )
9- load ("@npm//@angular/build-tooling/bazel/spec-bundling:index.bzl" , _spec_bundle = "spec_bundle" )
109load ("@npm//@angular/build-tooling/bazel/http-server:index.bzl" , _http_server = "http_server" )
1110load ("@npm//@angular/build-tooling/bazel:extract_js_module_output.bzl" , "extract_js_module_output" )
1211load ("@npm//@bazel/protractor:index.bzl" , _protractor_web_test_suite = "protractor_web_test_suite" )
1312load ("//:packages.bzl" , "NO_STAMP_NPM_PACKAGE_SUBSTITUTIONS" , "NPM_PACKAGE_SUBSTITUTIONS" )
1413load ("//:pkg-externals.bzl" , "PKG_EXTERNALS" )
1514load ("//tools/markdown-to-html:index.bzl" , _markdown_to_html = "markdown_to_html" )
1615load ("//tools/extract-tokens:index.bzl" , _extract_tokens = "extract_tokens" )
17- load ("//tools/angular:index.bzl" , "LINKER_PROCESSED_FW_PACKAGES" )
1816load ("//tools/bazel:ng_package_interop.bzl" , "ng_package_interop" )
19- load ("//tools:defaults2.bzl" , _karma_web_test_suite = "karma_web_test_suite" )
17+ load ("//tools:defaults2.bzl" , "spec_bundle" , _karma_web_test_suite = "karma_web_test_suite" )
2018
2119npmPackageSubstitutions = select ({
2220 "//tools:stamp" : NPM_PACKAGE_SUBSTITUTIONS ,
@@ -145,7 +143,6 @@ def protractor_web_test_suite(name, deps, **kwargs):
145143 spec_bundle (
146144 name = "%s_bundle" % name ,
147145 deps = deps ,
148- platform = "cjs-legacy" ,
149146 external = ["protractor" , "selenium-webdriver" ],
150147 )
151148
@@ -250,39 +247,6 @@ def ng_web_test_suite(deps = [], static_css = [], exclude_init_script = False, *
250247 ** kwargs
251248 )
252249
253- def spec_bundle (name , deps , ** kwargs ):
254- # TODO: Rename once devmode and prodmode have been combined.
255- # For spec bundling we also only consume devmode output as it is ESM in this repository.
256- # This helps speeding up development experience as ESBuild (used internally by the rule)
257- # would request both devmode and prodmode output flavor (resulting in 2x TS compilations).
258- extract_js_module_output (
259- name = "%s_devmode_deps" % name ,
260- deps = deps ,
261- provider = "JSModuleInfo" ,
262- forward_linker_mappings = True ,
263- include_external_npm_packages = True ,
264- include_default_files = False ,
265- include_declarations = False ,
266- testonly = True ,
267- )
268-
269- _spec_bundle (
270- name = name ,
271- # For specs, we always add the pre-processed linker FW packages so that these
272- # are resolved instead of the unprocessed FW entry-points through the `node_modules`.
273- deps = ["%s_devmode_deps" % name ] + LINKER_PROCESSED_FW_PACKAGES ,
274- workspace_name = "angular_material" ,
275- run_angular_linker = select ({
276- # Depending on whether partial compilation is enabled, we may want to run the linker
277- # to test the Angular compiler linker AOT processing. Additionally, a config setting
278- # can forcibly disable the linker to ensure tests rely on JIT linking at runtime.
279- "//tools:force_partial_jit_compilation_enabled" : False ,
280- "//tools:partial_compilation_enabled" : True ,
281- "//conditions:default" : False ,
282- }),
283- ** kwargs
284- )
285-
286250# TODO: Rename once devmode and prodmode have been combined.
287251def devmode_esbuild (name , deps , testonly = False , ** kwargs ):
288252 """Extension of the default `@bazel/esbuild` rule so that only devmode ESM output
0 commit comments