Is it possible to bundle for iOS JavascriptCore? #1017
Labels
kind: support
Asking for support with something or a specific use case
solution: already possible
This is already possible / this feature already exists
Current Behavior
I'm trying to bundle my package for use in Apple's iOS JavascriptCore context. This context doesn't have browser globals such as
window
anddocument
, but it also doesn't have Node globals such asrequire
.I'm finding that if I bundle for the browser then, naturally, my underlying dependencies expect things like
document
to be there. And if I bundle for Node, then the result attempts to require or import the dependencies at runtime.Desired Behavior
Perhaps I'm missing a trick here, but I feel like I need to create a sort of hybrid bundle that runs as if it is in Node, but it contains all the dependencies inline (like you would do for a browser bundle).
Is that possible already? Or is there a better solution?
Suggested Solution
Hopefully what I want to achieve is already possible with one of the existing module formats, but if not perhaps
iife
would work? #788Who does this impact? Who is this for?
People, like me, who want to be able to create a package that can be used by both the front end dev team and also the native app dev team.
Describe alternatives you've considered
I've attempted re-bundling the TSDX output with webpack, which seems like it should be unnecessary.
Additional context
Here's my SO question with a bit more detail: https://stackoverflow.com/questions/67193663/how-to-bundle-tsdx-package-for-ios-javascriptcore
The bundle for the React app works great; TSDX made that super easy - thank you.
The text was updated successfully, but these errors were encountered: