Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

exports included in exports file

$
0
0

I have a file globals.js in which i have a some useful global stuff exported and also a dictionary:

...
 
exports.theme = {
    ...
}
 
...
 
exports.dictionary = {
 
    bla = "blabla";
    bla2 = "blabla2";
    ...
 
}
 
...
When i need to use something from this file I require it (Ti.require('globals.js');) and I use the dictionary words.

What I want to do, is take the dictionary exports to another file and include that file inside globals.js but when I do that the compiler does not recognise exports.dictionary and it tries to find exports as a variable (so throws error because it is undefined).

What should I do? I do not want to change the way I am working since I have it in more than 5 projects like that.


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>