diff --git a/src/playground/benchmark.js b/src/playground/benchmark.js index ae2554a43..e86543df2 100644 --- a/src/playground/benchmark.js +++ b/src/playground/benchmark.js @@ -1,3 +1,6 @@ +const ScratchStorage = require('scratch-storage'); +const VirtualMachine = require('..'); + const Scratch = window.Scratch = window.Scratch || {}; const ASSET_SERVER = 'https://cdn.assets.scratch.mit.edu/'; @@ -439,12 +442,12 @@ class ProfilerRun { const runBenchmark = function () { // Lots of global variables to make debugging easier // Instantiate the VM. - const vm = new window.VirtualMachine(); + const vm = new VirtualMachine(); Scratch.vm = vm; vm.setTurboMode(true); - const storage = new ScratchStorage(); /* global ScratchStorage */ + const storage = new ScratchStorage(); const AssetType = storage.AssetType; storage.addWebSource([AssetType.Project], getProjectUrl); storage.addWebSource([AssetType.ImageVector, AssetType.ImageBitmap, AssetType.Sound], getAssetUrl); @@ -481,7 +484,6 @@ const runBenchmark = function () { vm.attachRenderer(renderer); const audioEngine = new window.AudioEngine(); vm.attachAudioEngine(audioEngine); - /* global ScratchSVGRenderer */ vm.attachV2SVGAdapter(new ScratchSVGRenderer.SVGRenderer()); vm.attachV2BitmapAdapter(new ScratchSVGRenderer.BitmapAdapter()); @@ -555,7 +557,7 @@ const runBenchmark = function () { * @param {object} json data from a previous benchmark run. */ const renderBenchmarkData = function (json) { - const vm = new window.VirtualMachine(); + const vm = new VirtualMachine(); new ProfilerRun({vm}).render(json); setShareLink(json); }; diff --git a/src/playground/index.html b/src/playground/index.html index 383f32270..107c593fb 100644 --- a/src/playground/index.html +++ b/src/playground/index.html @@ -79,16 +79,6 @@
- - - - - - - - - - diff --git a/webpack.config.js b/webpack.config.js index 1251207c8..86f9645bc 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -88,19 +88,7 @@ module.exports = [ defaultsDeep({}, base, { target: 'web', entry: { - 'scratch-vm': './src/index.js', - 'vendor': [ - // FPS counter - 'stats.js/build/stats.min.js', - // Scratch Blocks - 'scratch-blocks/dist/vertical.js', - // Audio - 'scratch-audio', - // Storage - 'scratch-storage', - // Renderer - 'scratch-render' - ], + 'benchmark': './src/playground/benchmark', 'video-sensing-extension-debug': './src/extensions/scratch3_video_sensing/debug' }, output: {