Only expose VirtualMachine to window for bundles

This commit is contained in:
Ray Schamp 2016-09-20 10:29:47 -04:00
parent 499ba5235c
commit fa10a2279a
5 changed files with 788 additions and 410 deletions

View file

@ -20,6 +20,7 @@
},
"devDependencies": {
"eslint": "2.7.0",
"expose-loader": "0.7.1",
"highlightjs": "8.7.0",
"json-loader": "0.5.4",
"scratch-blocks": "git+https://git@github.com/LLK/scratch-blocks.git#develop",

View file

@ -228,8 +228,5 @@ VirtualMachine.prototype.emitWorkspaceUpdate = function () {
'xml': this.editingTarget.blocks.toXML()
});
};
/**
* Export and bind to `window`
*/
module.exports = VirtualMachine;
if (typeof window !== 'undefined') window.VirtualMachine = module.exports;

1159
vm.js

File diff suppressed because it is too large Load diff

12
vm.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -14,6 +14,9 @@ module.exports = {
{
test: /\.json$/,
loader: 'json-loader'
}, {
test: require.resolve('./src/index.js'),
loader: 'expose?VirtualMachine'
}
]
},