-
Notifications
You must be signed in to change notification settings - Fork 12k
loading 3rd party vendor node modules with sub dependencies #1222
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
Comments
This is an important issue- both in regards the documentation, but also for newcomers using angular-cli, like me. The first thing I tried to do with my new angular-cli project is use a commonjs module (which does not have typescript typings)
That did not work, because the build system doesn't know about require(). I hit upon this after some searching.
But that didn't solve it either- the require cannot resolve the path to node_modules. The wiki article mentioned above helps, for small bits of code in vendorNpmFiles, but if it cannot discover commonjs module dependencies, I can't see how it would be useful at all in practice. Now I am thinking I will have to replace the angular-cli provided build and bundle scripts with a webpack implementation. Unless anyone else has pointers for how to accomplish the subject of this issue? |
Currently, all subdependencies you need have to be declared for the build system to pick them up. We are working on improving this, and there is an issue tracking it in #882. @guidorice try importing it via typescript: |
until #882 will be solved, here is an example of a project with |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Uh oh!
There was an error while loading. Please reload this page.
Loading a single node module is described within the wiki pretty well. Just being curious, how do I nicely load a more complex node module within a project bootstrapped with angular-cli?
E.g. angular2-apollo relies on several sub-dependencies like apollo-client, graphql, lodash, ...
I added the node module to
angular-cli-build.js
And registered the node module ins system.js with
However this is only loading angular2-apollo. The sub-dependencies of angular2-apollo are not getting loaded. How do I load subdependencies with system.js within angular-cli bootstraped project?
Wouldn't it be awesome having an ng helper registering and loading third party libraries?
The text was updated successfully, but these errors were encountered: