Project: titanium
Issue TIMOB-23490: Packaged JavaScript and Hybrid Modules: it doesn't work properly
When I create a pure Javascript Module, any exported method is accessible. In detail for the module I've: # Created a new Mobile Module Project, from Appcelerator Studio, with id (for example) it.module.test # Inside _assets_ folder, I've created a js file called _it.module.test.js_ # Into _it.module.test.js_ I have: {code:javascript} module.exports = { something: "hi" } {code} Now I package this module directly from Appcelerator Studio and install this module inside a Test Application. Into this application I do: {code:javascript} var module = require("it.module.test"); Ti.API.info(module.something); {code} And the result is *null*. The problem is that the native module classes are being called instead of the CommonJS ones as per the docs. __UPDATE__ After several tests, it seems that the problem is the Titanium SDK 4.0.0. When I create the module project inside Appcelerator Studio and selecting a previous version of Titanium SDK (3.4.1 for example) all works perfectly with the same code.
Story points: 8