[AC-3240] Compile All Folders
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | n/a |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2013-03-08T22:40:37.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Alloy, Titanium SDK & CLI |
Labels | alloy, build, compile |
Reporter | Joe Longstreet |
Assignee | Tony Lukasavage |
Created | 2013-02-27T03:42:54.000+0000 |
Updated | 2016-03-08T07:57:39.000+0000 |
Description
When compiling/building an alloy project, it would be great if all folders within the app directory were automatically moved to the Resources directory. Currently only specified directories (controllers, models, etc) get moved.
Moving all folders during the build would allow usage of normal commonjs patterns. Currently, the only way to use require is by placing exports within the assets directory, where it doesn't seem to fit.
Example:
app
|--> controllers
|--> index.js
|--> models
|--> views
|--> utils
|--> math.js
In stuff:
exports.add = function(a, b){
return a + b
}
in index:
var math = require('math');
math.add(5, 3);
We plan to stick to the convention of having both the "app/assets" and "app/lib" folders move their contents into the Resources folder during the compile process. The "app/lib" folder is a more appropriate place for your commonjs files. http://docs.appcelerator.com/titanium/latest/#!/guide/Alloy_Concepts-section-34636240_AlloyConcepts-ConventionoverConfiguration
Wow, totally missed that in the docs. Thanks for the clarification.