ti-commonjs
ti-commonjs copied to clipboard
Better support for native modules
It does not seem possible to load native modules with the new require()
method. So am using the tirequire()
method. No problems so far.
However, it is currently not possible to use Alloy's <Module>
tag in Alloy XML, since it uses the new require()
method as well!
There’s a simple yet dangerous way of solving this, that is to fallback to the original require
if ours fail.
In code terms that means try/catching the resolution of the path and then try to require the path as is with Titanium’s.
I’ll have a look at this very soon.