Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bazel): add terser as an optional peer dependency #33891

Closed
wants to merge 1 commit into from

Conversation

@alan-agius4
Copy link
Contributor

alan-agius4 commented Nov 18, 2019

ng_package rule has an implicitly optional depedency on terser

_DEFAULT_TERSER = "@npm//terser/bin:terser"

When using this rule without terser being available we get the below error;

ERROR: /home/circleci/ng/modules/express-engine/BUILD.bazel:22:1: every rule of type ng_package implicitly depends upon the target '@npm//terser/bin:terser', but this target could not be found because of: no such package '@npm//terser/bin': BUILD file not found in directory 'terser/bin' of external repository @npm. Add a BUILD file to a directory to mark it as a package.
ERROR: Analysis of target '//modules/express-engine:npm_package' failed; build aborted: no such package '@npm//terser/bin': BUILD file not found in directory 'terser/bin' of external repository @npm. Add a BUILD file to a directory to mark it as a package.
`ng_package` rule has an implicitly optional depedency on terser https://github.com/angular/angular/blob/a48573efe8eca12ccfbe0c11fb60f322387bf79a/packages/bazel/src/ng_package/ng_package.bzl#L36

When using this rule without terser being available we get the below error;
```
ERROR: /home/circleci/ng/modules/express-engine/BUILD.bazel:22:1: every rule of type ng_package implicitly depends upon the target '@npm//terser/bin:terser', but this target could not be found because of: no such package '@npm//terser/bin': BUILD file not found in directory 'terser/bin' of external repository @npm. Add a BUILD file to a directory to mark it as a package.
ERROR: Analysis of target '//modules/express-engine:npm_package' failed; build aborted: no such package '@npm//terser/bin': BUILD file not found in directory 'terser/bin' of external repository @npm. Add a BUILD file to a directory to mark it as a package.
```
@alan-agius4 alan-agius4 requested a review from gregmagolan Nov 18, 2019
@alan-agius4 alan-agius4 requested a review from angular/tools-bazel as a code owner Nov 18, 2019
@googlebot googlebot added the cla: yes label Nov 18, 2019
@ngbot ngbot bot added this to the needsTriage milestone Nov 18, 2019
Copy link
Contributor

gregmagolan left a comment

LGTM. Thanks @alan-agius4!

@kyliau
kyliau approved these changes Nov 18, 2019
@alxhub alxhub closed this in ffa3936 Nov 19, 2019
alxhub added a commit that referenced this pull request Nov 19, 2019
`ng_package` rule has an implicitly optional depedency on terser https://github.com/angular/angular/blob/a48573efe8eca12ccfbe0c11fb60f322387bf79a/packages/bazel/src/ng_package/ng_package.bzl#L36

When using this rule without terser being available we get the below error;
```
ERROR: /home/circleci/ng/modules/express-engine/BUILD.bazel:22:1: every rule of type ng_package implicitly depends upon the target '@npm//terser/bin:terser', but this target could not be found because of: no such package '@npm//terser/bin': BUILD file not found in directory 'terser/bin' of external repository @npm. Add a BUILD file to a directory to mark it as a package.
ERROR: Analysis of target '//modules/express-engine:npm_package' failed; build aborted: no such package '@npm//terser/bin': BUILD file not found in directory 'terser/bin' of external repository @npm. Add a BUILD file to a directory to mark it as a package.
```

PR Close #33891
@alan-agius4 alan-agius4 deleted the alan-agius4:terser-error branch Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.