From e67743a4bac98b053f0ada0658751a080586d642 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Fri, 16 Feb 2018 10:05:54 -0500 Subject: [PATCH] Require assets inside a try/catch --- src/extensions/scratch3_music/index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/extensions/scratch3_music/index.js b/src/extensions/scratch3_music/index.js index 0c9b45e7f..386c2c4a6 100644 --- a/src/extensions/scratch3_music/index.js +++ b/src/extensions/scratch3_music/index.js @@ -4,7 +4,17 @@ const Clone = require('../../util/clone'); const Cast = require('../../util/cast'); const MathUtil = require('../../util/math-util'); const Timer = require('../../util/timer'); -const assetData = require('./manifest'); + +/** + * The instrument and drum sounds, loaded as static assets. + * @type {object} + */ +let assetData = {}; +try { + assetData = require('./manifest'); +} catch (e) { + // Non-webpack environment, don't worry about assets. +} /** * Icon svg to be displayed at the left edge of each extension block, encoded as a data URI.