-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Is it possible to use apollo-client through a CDN? #4595
Comments
What errors does this url: https://unpkg.com/[email protected]/bundle.umd.js provide for you? If you can give some tips on this I might be able to fix it |
Simply adding |
From my understanding it is not actually possible to achieve this. The apollo bundle depends on graphql-js which has a similar issue to this one. One of the answers there is:
A possible solution for my case would be to bundle apollo+graphql as a single file and host it on a cdn. That way I will be able to reuse it across multiple projects. |
Timely! I was hoping to do this yesterday, too... «sigh» |
Although I/we have some exciting ideas for better ways to deliver the Apollo Client libraries (from a CDN, separate from the main application JS bundle, with better caching), I'm afraid @MartinManev's comment is exactly correct for the time being. In general, only libraries that have no external dependencies can be (easily) loaded as UMD bundles from unpkg.com. |
are there any alternatives or workaround to use this via CDN . |
are there any alternatives or workaround to use this via CDN ? |
1 similar comment
are there any alternatives or workaround to use this via CDN ? |
Yes here's the example from Akryum https://jsfiddle.net/Akryum/oyejk2qL/ |
Is there any rollup config that can make up such a bundle? |
@jayshah123 see #8222 (coming in 3.4) |
To me it seems like a very basic thing to do but I'm not seeing any documentation or obvious way to do it. I don't see any file in jsDelivr or UNPKG that is designed to be included this way. I tried bundle.umd.js but it produces various errors for the different libraries (apollo-client, apollo-link, apollo-link-http, apollo-cache-inmemory, ...). Could someone provide a working example of this?
The text was updated successfully, but these errors were encountered: