Open ghost opened 9 years ago
You pointed what in my humble opinion is the biggest issue with the current resolving algorithm.
Currently it resolves things as they are in the resulting app, that means that in a controller to reference a file in the lib directory you’ll need to do require('../../filename')
. That’s because files in the lib
dir will be placed inside the root of the Resources
while controllers will be placed in Resources/alloy/controllers/*
.
This is madness.
http://docs.appcelerator.com/titanium/latest/#!/api/Global-method-require says:
What is the best way to organize things that were in app/lib when adopting ti-commonjs? There doesn't appear to be a way to add another search path, and ti-commonjs uses Resources whereas traditional Alloy appears to use both Resources and app/lib.
The options as I see them:
Are there any other options? Any suggestions? Thanks!