fix: loading messages from script tags. (#6184)

* fix: loading messages in the browser

* chore: fix comment

* fix: change unwrapped message files to write to a new object, rather than Blockly.Msg

* fix: fixup exports

* fix: PR comments

* fix: change to use for-in loop

* fix: ES6 compatibility and formatting
This commit is contained in:
Beka Westberg
2022-06-13 14:13:54 -07:00
committed by GitHub
parent f31a3fbaa2
commit 2a7d6b08b5
3 changed files with 27 additions and 12 deletions

View File

@@ -0,0 +1,16 @@
/* eslint-disable */
;(function(root, factory) {
if (typeof define === 'function' && define.amd) { // AMD
define(<%= amd %>, factory);
} else if (typeof exports === 'object') { // Node.js
module.exports = factory();
} else { // Browser
var messages = factory();
for (var key in messages) {
root.<%= namespace %>[key] = messages[key];
}
}
}(this, function() {
<%= contents %>
return messages;
}));