Most Node packages expose themselves via AMD, CommonJS (module.exports), or globals depending on the environment. I understand that React-native does indeed support AMD, but is there any way to force modules to be treated as CommonJS?
Steps to reproduce:
-
Create a new React Native project
-
Run npm install exoskeleton (this, along with jsSHA, are the first two libraries I noticed this with)
-
Add the following to index.ios.js:
var Exoskeleton = require('exoskeleton');
console.log(Exoskeleton);
-
Notice how, in the debug console, an empty object is logged.