mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Fix DOMParser in node.js
This commit is contained in:
@@ -1586,6 +1586,11 @@ delete this.BLOCKLY_DIR;
|
||||
delete this.BLOCKLY_BOOT;
|
||||
};
|
||||
|
||||
if (typeof DOMParser == 'undefined' && typeof require == 'function') {
|
||||
// Node.js needs DOMParser loaded separately.
|
||||
var DOMParser = require('xmldom').DOMParser;
|
||||
}
|
||||
|
||||
// Delete any existing Closure (e.g. Soy's nogoog_shim).
|
||||
document.write('<script>var goog = undefined;</script>');
|
||||
// Load fresh Closure Library.
|
||||
|
||||
5
build.py
5
build.py
@@ -132,6 +132,11 @@ delete this.BLOCKLY_DIR;
|
||||
delete this.BLOCKLY_BOOT;
|
||||
};
|
||||
|
||||
if (typeof DOMParser == 'undefined' && typeof require == 'function') {
|
||||
// Node.js needs DOMParser loaded separately.
|
||||
var DOMParser = require('xmldom').DOMParser;
|
||||
}
|
||||
|
||||
// Delete any existing Closure (e.g. Soy's nogoog_shim).
|
||||
document.write('<script>var goog = undefined;</script>');
|
||||
// Load fresh Closure Library.
|
||||
|
||||
Reference in New Issue
Block a user