Skip to content

Commit 845f8df

Browse files
committed
build: fix app_bundle rule after migrating packages/compiler
The `app_bundle` rule does not work after the migration of `packages/compiler` to `ts_project` because the `.mjs` extensions are now missing in the non npm-package output. This causes runtime errors as `.js` is not recognized as ESM. Switching to the real npm package for usage, fixes this issue.
1 parent c7ac9df commit 845f8df

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

packages/compiler/BUILD.bazel

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:defaults.bzl", "ng_package", "tsec_test")
1+
load("//tools:defaults.bzl", "ng_package", "pkg_npm", "tsec_test")
22
load("//tools:defaults2.bzl", "npm_package", "ts_project")
33

44
package(default_visibility = ["//visibility:public"])
@@ -57,6 +57,14 @@ npm_package(
5757
},
5858
)
5959

60+
# TODO(devversion): Temporary linkable `pkg_npm` for making compiler usable with the rules_nodejs linker.
61+
# Long-term, `pkg_npm` will be migrated to `npm_package` in general.
62+
pkg_npm(
63+
name = "linkable_npm_package",
64+
package_name = "@angular/compiler",
65+
nested_packages = [":npm_package"],
66+
)
67+
6068
filegroup(
6169
name = "files_for_docgen",
6270
srcs = glob([

packages/core/test/bundling/router/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ ts_project(
4646
jasmine_node_test(
4747
name = "test",
4848
data = [
49-
":bundle",
5049
":bundle.debug.min.js",
5150
":bundle.js",
5251
":bundle.min.js",

tools/esm-interop/patches/npm/@angular+build-tooling+0.0.0-2670abf637fa155971cdd1f7e570a7f234922a65.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ index d6249b8..707ae39 100755
4343
config_file = ":%s_config_file" % name,
4444
deps = [
4545
- "@npm//@angular/compiler-cli",
46-
+ "@angular//packages/compiler:npm_package",
46+
+ "@angular//packages/compiler:linkable_npm_package",
4747
+ "@angular//packages/compiler-cli:npm_package",
4848
"@npm//@angular/build-tooling/shared-scripts/angular-optimization:js_lib",
4949
],

0 commit comments

Comments
 (0)