Update build.py with more robust nodejs identification

This commit is contained in:
carlosperate
2016-01-16 22:11:33 +00:00
parent dc1f03a168
commit 655f0368e3

View File

@@ -79,7 +79,8 @@ class Gen_uncompressed(threading.Thread):
f = open(target_filename, 'w')
f.write(HEADER)
f.write("""
var isNodeJS = !!(typeof module !== 'undefined' && module.exports);
var isNodeJS = !!(typeof module !== 'undefined' && module.exports &&
typeof window === 'undefined');
if (isNodeJS) {
var window = {};