Skip to content

Conversation

@alexeagle
Copy link
Collaborator

Greatly simplifies code, and works with the npm deps users already take. Otherwise we have to instruct them to add @Angular-devkit packages to their devDeps.

Also includes fixes to make it work with Angular v20 which has slightly different dependencies and different angular.json

Greatly simplifies code, and works with the npm deps users already take.
Otherwise we have to instruct them to add @Angular-devkit packages to their devDeps.
@alexeagle
Copy link
Collaborator Author

I've updated aspect-build/bazel-examples#417 to the new /src path.

I have one error there I could use some eyes on, from running bazel test //angular/projects/my-lib:test which is tagged no-sandbox:

Application bundle generation failed. [2.859 seconds]

✘ [ERROR] File '../../../../src/lib/my-lib.spec.ts' is missing from the TypeScript compilation. [plugin angular-compiler]

  Ensure the file is part of the TypeScript program via the 'files' or 'include' property.


✘ [ERROR] Could not resolve "@angular/core/testing"

    ../../../../../../../node_modules/.aspect_rules_js/@angular+build@20.0.0-next.3_1309402193/node_modules/@angular/build/src/builders/karma/polyfills/init_test_bed.js:9:27:
      9 │ import { getTestBed } from '@angular/core/testing';
        ╵                            ~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@angular/core/testing" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

@devversion
Copy link
Owner

devversion commented Mar 31, 2025

The second error looks legit. The @angular/build package seems to miss this dependency (as esbuild seems to pick it up from where it's defined?) https://github.com/angular/angular-build-builds/blob/main/package.json. cc. @clydin

@alexeagle
Copy link
Collaborator Author

@clydin hi again! Any time or interest in investigating that second error with missing dependency edge? Do you want me to file an issue on another repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants