Bazel: ng test with third-party lib shipped as AMD module #30271
Labels
area: bazel
Issues related to the published `@angular/bazel` build rules
freq1: low
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
type: bug/fix
Milestone
🐞 bug report
Affected Package
The issue is caused by package @angular/bazel
Is this a regression?
No
Description
When starting a new project with the Bazel schematic, and adding a third party lib like Moment.js,
ng test
doesn't find the library.🔬 Minimal Reproduction
A full repro can be find here: https://github.com/cexbrayat/bazel-moment
It can be manually reproduce by creating a project with:
and update the generated pipe to look like:
and use it in
app.component.html
:Create a
require.config.js
file with:Update the
BUILD.bazel
file:Then run
ng serve
: it works.Now update the pipe test:
And run
ng test
.This will fail with:
I was hoping to fix it the same way used for
ts_devserver
:but
moment.js
still can't be find (it now uses therequire.config.js
as expected, but the lib is not served despite adding it tostatic_files
,data
,web_test_data
andsrcs
).There is maybe a simple configuration that escapes me, but maybe this is an issue.
🔥 Exception or Error
🌍 Your Environment
Angular Version:
Anything else relevant?
cc @kyliau as we talked about it on Slack.
The text was updated successfully, but these errors were encountered: