mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
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:
16
scripts/package/templates/umd-msg.template
Normal file
16
scripts/package/templates/umd-msg.template
Normal 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;
|
||||
}));
|
||||
Reference in New Issue
Block a user