Loading AMD module inside JavaScriptCore

Viewed 679

I would like to load a javascript module inside JavascriptCore (on iOS).

I'm fetching the text of the file via a normal HTTP request on the iOS side. So I can parse that entire string into the JScontext.

But now I'd like to load that module, and ideally, resolve any other dependencies, although this is not essential.

I've tried using requireJS for node, but it seems to have lots of dependency errors, and perhaps it is a bit out of date.

I've also tried steal, but I'm not sure if that is the right path either. I've also tried this. https://github.com/millermedeiros/nodefy

Essentially I want to do what require js does in the browser, but in a pure javascript environment (no browser, no node).

I also want to bundle everything down using browserify, and have looked at things like this - RequireJS load string

The problem is, when I go to browserify the code, (requiring, requirejs) the process fails with unfound dependencies?

Can anyone point me in the right direction?

1 Answers
Related