ti-commonjs icon indicating copy to clipboard operation
ti-commonjs copied to clipboard

Better support for native modules

Open timanrebel opened this issue 10 years ago • 1 comments

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!

timanrebel avatar May 15 '14 09:05 timanrebel

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.

yuchi avatar Apr 06 '15 14:04 yuchi