mirror of
https://github.com/google/blockly.git
synced 2026-01-08 17:40:09 +01:00
Update build.py with more robust nodejs identification
This commit is contained in:
3
build.py
3
build.py
@@ -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 = {};
|
||||
|
||||
Reference in New Issue
Block a user