Merge pull request #237 from carlosperate/fix_electron

Update build.py with more robust nodejs identification
This commit is contained in:
Neil Fraser
2016-02-04 13:57:36 -08:00

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 = {};