Playground: use UMD to load storage as global ()

* Playground: use UMD to load storage as global

It appears that `expose-loader` is not compatible with WebPack's UMD
exporter, so the VM playground broke when I converted `scratch-storage`
to use UMD. This change causes the playground to load `scratch-storage`
as an independent script and relies on its UMD loader to expose it as a
global. Bonus points: we get better source mapping this way.

* Playground: tell eslint about global ScratchStorage
This commit is contained in:
Chris Willis-Ford 2017-10-17 14:40:11 -07:00 committed by Ray Schamp
parent ceb47bd765
commit d8a3e659d5
3 changed files with 7 additions and 9 deletions

View file

@ -77,9 +77,7 @@ module.exports = [
// Audio
'scratch-audio',
// Renderer
'scratch-render',
// Storage
'scratch-storage'
'scratch-render'
]
},
output: {
@ -111,10 +109,6 @@ module.exports = [
{
test: require.resolve('scratch-render'),
loader: 'expose-loader?RenderWebGL'
},
{
test: require.resolve('scratch-storage'),
loader: 'expose-loader?Scratch.Storage'
}
])
},
@ -124,6 +118,8 @@ module.exports = [
to: 'media'
}, {
from: 'node_modules/highlightjs/styles/zenburn.css'
}, {
from: 'node_modules/scratch-storage/dist/web'
}, {
from: 'src/playground'
}])