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

external module in Angular CLI #8607

Closed
stepet80 opened this issue Nov 23, 2017 · 5 comments
Closed

external module in Angular CLI #8607

stepet80 opened this issue Nov 23, 2017 · 5 comments

Comments

@stepet80
Copy link

stepet80 commented Nov 23, 2017

Hello

We have the following situation:

  • application A provides a CDN JS bundle containing Angular objects to be used by a consuming application
  • application A provides an npm package called @myorg/core with only d.ts files an an index.d.ts file
  • application B adds a script tag towards the CDN bundle
  • application B consumes the npm package @myorg/core in an Angular CLI context
    --> So somewhere in a file an "import MyComponent from 'myorg/core'" is done which works fine (the d.ts files are detected and providing typing)
  • when the Angular cli ng build command is called it says that module myorg/core cannot be found

How can I make this work with Angular CLI?
In Webpack I would be able to use the externals property and this would work fine.

Actually I think it should be the same behavior as @types packages...

Thanks in advance.

@krishnakumarsingh
Copy link

Thanks

@filipesilva
Copy link
Contributor

We don't support building from external sources, and generally speaking AOT builds won't work with externals since they need the code to be present to statically analyze and produce ng factories.

Since it can't work with AOT I don't think we can support this usecase.

@stepet80
Copy link
Author

stepet80 commented Nov 23, 2017

So there is no way this could be added as a feature in case we build without AOT :) ?
The externals from the angular cli json file could just be passed to webpack with an error (not possible with AOT) or warning (no AOT build)...

@hansl hansl removed their assignment Feb 6, 2018
@mgechev mgechev closed this as completed Dec 22, 2018
@mgechev
Copy link
Member

mgechev commented Dec 22, 2018

#8607 (comment) we do not recommend JIT production build. Let us leave this out of the scope of the CLI.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants