Skip to content

@angular-devkit/build-angular removes custom library decorators from another libraries on production build #15301

Description

@abadakhshan

🐞 Bug report

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

I define some decorators on one of my libraries and use them a lot on other libraries.
When I build my application with --prod Angular compiler removes using of them in generated code.

This problem occurs with @angular-devkit/build-angular@0.802.0 and I have no problem with @angular-devkit/build-angular@0.801.3

Activity

  1. abadakhshan commented on Aug 11, 2019

    @abadakhshan
    Author

    I created a repository for demo

    https://github.com/abadakhshan/test-build-angular

    I have a decorator on "narik-core" (@NarikInject).
    Every @NarikInject used in "test-build-angular" source, works fine but those that used in libraries (for example in "narik-core" and "narik-app-core") do not work at all.

    If I change "@angular-devkit/build-angular" to "0.801.3" and "typescript" to "3.4.5" everything is OK.

    This happens on ng build --prod and there is no problem on "ng serve"

  2. changed the title [-]@angular-devkit/build-angular removes custom library decorators on production build[/-] [+]@angular-devkit/build-angular removes custom library decorators from another libraries on production build[/+] on Aug 11, 2019
  3. modified the milestone: needsTriage on Aug 11, 2019
  4. modified the milestones: needsTriage, Backlog on Aug 11, 2019
  5. alan-agius4 commented on Aug 11, 2019

    @alan-agius4
    Collaborator

    Similar things have also been reported here: ng-packagr/ng-packagr#1307

  6. self-assigned this
    on Aug 11, 2019
  7. added 2 commits that reference this issue on Aug 12, 2019
    e2bb482
    594343c
  8. angular-automatic-lock-bot commented on Sep 13, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  9. locked and limited conversation to collaborators on Sep 13, 2019
  10. added a commit that references this issue on May 29, 2026
    58b439a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions