To see the build failures when using the webpack_bundle
rule, do the following:
- Update the
MODULE
value inmodule_type.bzl
to one ofnone
orcommonjs
. - Execute
bazel build //:bundle
As far as I can tell, when using commonjs
or none
, the generated output should be resolvable by Node itself.
The tsc
-generated JavaScript in these cases requires based purely on the original import declaration. However,
the LinkablePackageInfo
does not take into account module_root
, so these import attempts fail to resolve
(e.g. bazel has made JS module foo
available under .../package_foo/src/foo
, but mapped package_foo
to
.../package_foo
).
Interestingly, it works fine under module-type umd
, as tsc
rewrites the import to account for this (e.g.
TS referencing foo/foo
becomes JS referencing foo/src/foo
).