fix: music extension sounds were not loading correctly

This commit is contained in:
Christopher Willis-Ford 2024-09-07 01:01:06 -07:00
parent 5a6646f664
commit c3759e8e99
4 changed files with 67 additions and 77 deletions

10
package-lock.json generated
View file

@ -58,7 +58,7 @@
"scratch-l10n": "3.18.293", "scratch-l10n": "3.18.293",
"scratch-render-fonts": "1.0.95", "scratch-render-fonts": "1.0.95",
"scratch-semantic-release-config": "1.0.14", "scratch-semantic-release-config": "1.0.14",
"scratch-webpack-configuration": "1.4.0", "scratch-webpack-configuration": "1.5.0",
"script-loader": "0.7.2", "script-loader": "0.7.2",
"semantic-release": "19.0.5", "semantic-release": "19.0.5",
"stats.js": "0.17.0", "stats.js": "0.17.0",
@ -20736,17 +20736,17 @@
"license": "BSD-3-Clause" "license": "BSD-3-Clause"
}, },
"node_modules/scratch-webpack-configuration": { "node_modules/scratch-webpack-configuration": {
"version": "1.4.0", "version": "1.5.0",
"resolved": "https://registry.npmjs.org/scratch-webpack-configuration/-/scratch-webpack-configuration-1.4.0.tgz", "resolved": "https://registry.npmjs.org/scratch-webpack-configuration/-/scratch-webpack-configuration-1.5.0.tgz",
"integrity": "sha512-fJfppB4S1ZE9pfGw1EfI2RNHY36Fe0YB/P0m/xcXe+Xt/wN/hw7CsZVKme6D/YQQmJ+c9TAuIo36xeuVrwZ1Pg==", "integrity": "sha512-PNPPNsks/FnFgJH2qS5GMfwAMKsDscCYtPzj4rV6sFjG1ijbvYiCammR9hpRsJ8vdoalDELQg7IiAJuFjqoaow==",
"dev": true, "dev": true,
"license": "BSD-3-Clause",
"dependencies": { "dependencies": {
"lodash.merge": "^4.6.2", "lodash.merge": "^4.6.2",
"webpack-node-externals": "^3.0.0" "webpack-node-externals": "^3.0.0"
}, },
"peerDependencies": { "peerDependencies": {
"@babel/preset-env": "^7.24.0", "@babel/preset-env": "^7.24.0",
"arraybuffer-loader": "^1.0.8",
"autoprefixer": "^9.0.1", "autoprefixer": "^9.0.1",
"babel-loader": "^9.1.3", "babel-loader": "^9.1.3",
"css-loader": "5.2.7", "css-loader": "5.2.7",

View file

@ -102,7 +102,7 @@
"scratch-l10n": "3.18.293", "scratch-l10n": "3.18.293",
"scratch-render-fonts": "1.0.95", "scratch-render-fonts": "1.0.95",
"scratch-semantic-release-config": "1.0.14", "scratch-semantic-release-config": "1.0.14",
"scratch-webpack-configuration": "1.4.0", "scratch-webpack-configuration": "1.5.0",
"script-loader": "0.7.2", "script-loader": "0.7.2",
"semantic-release": "19.0.5", "semantic-release": "19.0.5",
"stats.js": "0.17.0", "stats.js": "0.17.0",

View file

@ -1,65 +1,63 @@
module.exports = { module.exports = {
'drums/1-snare.mp3': require('!arraybuffer-loader!./assets/drums/1-snare.mp3'), 'drums/1-snare.mp3': require('./assets/drums/1-snare.mp3?arrayBuffer'),
'drums/2-bass-drum.mp3': require('!arraybuffer-loader!./assets/drums/2-bass-drum.mp3'), 'drums/2-bass-drum.mp3': require('./assets/drums/2-bass-drum.mp3?arrayBuffer'),
'drums/3-side-stick.mp3': require('!arraybuffer-loader!./assets/drums/3-side-stick.mp3'), 'drums/3-side-stick.mp3': require('./assets/drums/3-side-stick.mp3?arrayBuffer'),
'drums/4-crash-cymbal.mp3': require('!arraybuffer-loader!./assets/drums/4-crash-cymbal.mp3'), 'drums/4-crash-cymbal.mp3': require('./assets/drums/4-crash-cymbal.mp3?arrayBuffer'),
'drums/5-open-hi-hat.mp3': require('!arraybuffer-loader!./assets/drums/5-open-hi-hat.mp3'), 'drums/5-open-hi-hat.mp3': require('./assets/drums/5-open-hi-hat.mp3?arrayBuffer'),
'drums/6-closed-hi-hat.mp3': require('!arraybuffer-loader!./assets/drums/6-closed-hi-hat.mp3'), 'drums/6-closed-hi-hat.mp3': require('./assets/drums/6-closed-hi-hat.mp3?arrayBuffer'),
'drums/7-tambourine.mp3': require('!arraybuffer-loader!./assets/drums/7-tambourine.mp3'), 'drums/7-tambourine.mp3': require('./assets/drums/7-tambourine.mp3?arrayBuffer'),
'drums/8-hand-clap.mp3': require('!arraybuffer-loader!./assets/drums/8-hand-clap.mp3'), 'drums/8-hand-clap.mp3': require('./assets/drums/8-hand-clap.mp3?arrayBuffer'),
'drums/9-claves.mp3': require('!arraybuffer-loader!./assets/drums/9-claves.mp3'), 'drums/9-claves.mp3': require('./assets/drums/9-claves.mp3?arrayBuffer'),
'drums/10-wood-block.mp3': require('!arraybuffer-loader!./assets/drums/10-wood-block.mp3'), 'drums/10-wood-block.mp3': require('./assets/drums/10-wood-block.mp3?arrayBuffer'),
'drums/11-cowbell.mp3': require('!arraybuffer-loader!./assets/drums/11-cowbell.mp3'), 'drums/11-cowbell.mp3': require('./assets/drums/11-cowbell.mp3?arrayBuffer'),
'drums/12-triangle.mp3': require('!arraybuffer-loader!./assets/drums/12-triangle.mp3'), 'drums/12-triangle.mp3': require('./assets/drums/12-triangle.mp3?arrayBuffer'),
'drums/13-bongo.mp3': require('!arraybuffer-loader!./assets/drums/13-bongo.mp3'), 'drums/13-bongo.mp3': require('./assets/drums/13-bongo.mp3?arrayBuffer'),
'drums/14-conga.mp3': require('!arraybuffer-loader!./assets/drums/14-conga.mp3'), 'drums/14-conga.mp3': require('./assets/drums/14-conga.mp3?arrayBuffer'),
'drums/15-cabasa.mp3': require('!arraybuffer-loader!./assets/drums/15-cabasa.mp3'), 'drums/15-cabasa.mp3': require('./assets/drums/15-cabasa.mp3?arrayBuffer'),
'drums/16-guiro.mp3': require('!arraybuffer-loader!./assets/drums/16-guiro.mp3'), 'drums/16-guiro.mp3': require('./assets/drums/16-guiro.mp3?arrayBuffer'),
'drums/17-vibraslap.mp3': require('!arraybuffer-loader!./assets/drums/17-vibraslap.mp3'), 'drums/17-vibraslap.mp3': require('./assets/drums/17-vibraslap.mp3?arrayBuffer'),
'drums/18-cuica.mp3': require('!arraybuffer-loader!./assets/drums/18-cuica.mp3'), 'drums/18-cuica.mp3': require('./assets/drums/18-cuica.mp3?arrayBuffer'),
'instruments/1-piano/24.mp3': require('!arraybuffer-loader!./assets/instruments/1-piano/24.mp3'), 'instruments/1-piano/24.mp3': require('./assets/instruments/1-piano/24.mp3?arrayBuffer'),
'instruments/1-piano/36.mp3': require('!arraybuffer-loader!./assets/instruments/1-piano/36.mp3'), 'instruments/1-piano/36.mp3': require('./assets/instruments/1-piano/36.mp3?arrayBuffer'),
'instruments/1-piano/48.mp3': require('!arraybuffer-loader!./assets/instruments/1-piano/48.mp3'), 'instruments/1-piano/48.mp3': require('./assets/instruments/1-piano/48.mp3?arrayBuffer'),
'instruments/1-piano/60.mp3': require('!arraybuffer-loader!./assets/instruments/1-piano/60.mp3'), 'instruments/1-piano/60.mp3': require('./assets/instruments/1-piano/60.mp3?arrayBuffer'),
'instruments/1-piano/72.mp3': require('!arraybuffer-loader!./assets/instruments/1-piano/72.mp3'), 'instruments/1-piano/72.mp3': require('./assets/instruments/1-piano/72.mp3?arrayBuffer'),
'instruments/1-piano/84.mp3': require('!arraybuffer-loader!./assets/instruments/1-piano/84.mp3'), 'instruments/1-piano/84.mp3': require('./assets/instruments/1-piano/84.mp3?arrayBuffer'),
'instruments/1-piano/96.mp3': require('!arraybuffer-loader!./assets/instruments/1-piano/96.mp3'), 'instruments/1-piano/96.mp3': require('./assets/instruments/1-piano/96.mp3?arrayBuffer'),
'instruments/1-piano/108.mp3': require('!arraybuffer-loader!./assets/instruments/1-piano/108.mp3'), 'instruments/1-piano/108.mp3': require('./assets/instruments/1-piano/108.mp3?arrayBuffer'),
'instruments/2-electric-piano/60.mp3': require('!arraybuffer-loader!./assets/instruments/2-electric-piano/60.mp3'), 'instruments/2-electric-piano/60.mp3': require('./assets/instruments/2-electric-piano/60.mp3?arrayBuffer'),
'instruments/3-organ/60.mp3': require('!arraybuffer-loader!./assets/instruments/3-organ/60.mp3'), 'instruments/3-organ/60.mp3': require('./assets/instruments/3-organ/60.mp3?arrayBuffer'),
'instruments/4-guitar/60.mp3': require('!arraybuffer-loader!./assets/instruments/4-guitar/60.mp3'), 'instruments/4-guitar/60.mp3': require('./assets/instruments/4-guitar/60.mp3?arrayBuffer'),
'instruments/5-electric-guitar/60.mp3': require( 'instruments/5-electric-guitar/60.mp3': require('./assets/instruments/5-electric-guitar/60.mp3?arrayBuffer'),
'!arraybuffer-loader!./assets/instruments/5-electric-guitar/60.mp3' 'instruments/6-bass/36.mp3': require('./assets/instruments/6-bass/36.mp3?arrayBuffer'),
), 'instruments/6-bass/48.mp3': require('./assets/instruments/6-bass/48.mp3?arrayBuffer'),
'instruments/6-bass/36.mp3': require('!arraybuffer-loader!./assets/instruments/6-bass/36.mp3'), 'instruments/7-pizzicato/60.mp3': require('./assets/instruments/7-pizzicato/60.mp3?arrayBuffer'),
'instruments/6-bass/48.mp3': require('!arraybuffer-loader!./assets/instruments/6-bass/48.mp3'), 'instruments/8-cello/36.mp3': require('./assets/instruments/8-cello/36.mp3?arrayBuffer'),
'instruments/7-pizzicato/60.mp3': require('!arraybuffer-loader!./assets/instruments/7-pizzicato/60.mp3'), 'instruments/8-cello/48.mp3': require('./assets/instruments/8-cello/48.mp3?arrayBuffer'),
'instruments/8-cello/36.mp3': require('!arraybuffer-loader!./assets/instruments/8-cello/36.mp3'), 'instruments/8-cello/60.mp3': require('./assets/instruments/8-cello/60.mp3?arrayBuffer'),
'instruments/8-cello/48.mp3': require('!arraybuffer-loader!./assets/instruments/8-cello/48.mp3'), 'instruments/9-trombone/36.mp3': require('./assets/instruments/9-trombone/36.mp3?arrayBuffer'),
'instruments/8-cello/60.mp3': require('!arraybuffer-loader!./assets/instruments/8-cello/60.mp3'), 'instruments/9-trombone/48.mp3': require('./assets/instruments/9-trombone/48.mp3?arrayBuffer'),
'instruments/9-trombone/36.mp3': require('!arraybuffer-loader!./assets/instruments/9-trombone/36.mp3'), 'instruments/9-trombone/60.mp3': require('./assets/instruments/9-trombone/60.mp3?arrayBuffer'),
'instruments/9-trombone/48.mp3': require('!arraybuffer-loader!./assets/instruments/9-trombone/48.mp3'), 'instruments/10-clarinet/48.mp3': require('./assets/instruments/10-clarinet/48.mp3?arrayBuffer'),
'instruments/9-trombone/60.mp3': require('!arraybuffer-loader!./assets/instruments/9-trombone/60.mp3'), 'instruments/10-clarinet/60.mp3': require('./assets/instruments/10-clarinet/60.mp3?arrayBuffer'),
'instruments/10-clarinet/48.mp3': require('!arraybuffer-loader!./assets/instruments/10-clarinet/48.mp3'), 'instruments/11-saxophone/36.mp3': require('./assets/instruments/11-saxophone/36.mp3?arrayBuffer'),
'instruments/10-clarinet/60.mp3': require('!arraybuffer-loader!./assets/instruments/10-clarinet/60.mp3'), 'instruments/11-saxophone/60.mp3': require('./assets/instruments/11-saxophone/60.mp3?arrayBuffer'),
'instruments/11-saxophone/36.mp3': require('!arraybuffer-loader!./assets/instruments/11-saxophone/36.mp3'), 'instruments/11-saxophone/84.mp3': require('./assets/instruments/11-saxophone/84.mp3?arrayBuffer'),
'instruments/11-saxophone/60.mp3': require('!arraybuffer-loader!./assets/instruments/11-saxophone/60.mp3'), 'instruments/12-flute/60.mp3': require('./assets/instruments/12-flute/60.mp3?arrayBuffer'),
'instruments/11-saxophone/84.mp3': require('!arraybuffer-loader!./assets/instruments/11-saxophone/84.mp3'), 'instruments/12-flute/72.mp3': require('./assets/instruments/12-flute/72.mp3?arrayBuffer'),
'instruments/12-flute/60.mp3': require('!arraybuffer-loader!./assets/instruments/12-flute/60.mp3'), 'instruments/13-wooden-flute/60.mp3': require('./assets/instruments/13-wooden-flute/60.mp3?arrayBuffer'),
'instruments/12-flute/72.mp3': require('!arraybuffer-loader!./assets/instruments/12-flute/72.mp3'), 'instruments/13-wooden-flute/72.mp3': require('./assets/instruments/13-wooden-flute/72.mp3?arrayBuffer'),
'instruments/13-wooden-flute/60.mp3': require('!arraybuffer-loader!./assets/instruments/13-wooden-flute/60.mp3'), 'instruments/14-bassoon/36.mp3': require('./assets/instruments/14-bassoon/36.mp3?arrayBuffer'),
'instruments/13-wooden-flute/72.mp3': require('!arraybuffer-loader!./assets/instruments/13-wooden-flute/72.mp3'), 'instruments/14-bassoon/48.mp3': require('./assets/instruments/14-bassoon/48.mp3?arrayBuffer'),
'instruments/14-bassoon/36.mp3': require('!arraybuffer-loader!./assets/instruments/14-bassoon/36.mp3'), 'instruments/14-bassoon/60.mp3': require('./assets/instruments/14-bassoon/60.mp3?arrayBuffer'),
'instruments/14-bassoon/48.mp3': require('!arraybuffer-loader!./assets/instruments/14-bassoon/48.mp3'), 'instruments/15-choir/48.mp3': require('./assets/instruments/15-choir/48.mp3?arrayBuffer'),
'instruments/14-bassoon/60.mp3': require('!arraybuffer-loader!./assets/instruments/14-bassoon/60.mp3'), 'instruments/15-choir/60.mp3': require('./assets/instruments/15-choir/60.mp3?arrayBuffer'),
'instruments/15-choir/48.mp3': require('!arraybuffer-loader!./assets/instruments/15-choir/48.mp3'), 'instruments/15-choir/72.mp3': require('./assets/instruments/15-choir/72.mp3?arrayBuffer'),
'instruments/15-choir/60.mp3': require('!arraybuffer-loader!./assets/instruments/15-choir/60.mp3'), 'instruments/16-vibraphone/60.mp3': require('./assets/instruments/16-vibraphone/60.mp3?arrayBuffer'),
'instruments/15-choir/72.mp3': require('!arraybuffer-loader!./assets/instruments/15-choir/72.mp3'), 'instruments/16-vibraphone/72.mp3': require('./assets/instruments/16-vibraphone/72.mp3?arrayBuffer'),
'instruments/16-vibraphone/60.mp3': require('!arraybuffer-loader!./assets/instruments/16-vibraphone/60.mp3'), 'instruments/17-music-box/60.mp3': require('./assets/instruments/17-music-box/60.mp3?arrayBuffer'),
'instruments/16-vibraphone/72.mp3': require('!arraybuffer-loader!./assets/instruments/16-vibraphone/72.mp3'), 'instruments/18-steel-drum/60.mp3': require('./assets/instruments/18-steel-drum/60.mp3?arrayBuffer'),
'instruments/17-music-box/60.mp3': require('!arraybuffer-loader!./assets/instruments/17-music-box/60.mp3'), 'instruments/19-marimba/60.mp3': require('./assets/instruments/19-marimba/60.mp3?arrayBuffer'),
'instruments/18-steel-drum/60.mp3': require('!arraybuffer-loader!./assets/instruments/18-steel-drum/60.mp3'), 'instruments/20-synth-lead/60.mp3': require('./assets/instruments/20-synth-lead/60.mp3?arrayBuffer'),
'instruments/19-marimba/60.mp3': require('!arraybuffer-loader!./assets/instruments/19-marimba/60.mp3'), 'instruments/21-synth-pad/60.mp3': require('./assets/instruments/21-synth-pad/60.mp3?arrayBuffer')
'instruments/20-synth-lead/60.mp3': require('!arraybuffer-loader!./assets/instruments/20-synth-lead/60.mp3'),
'instruments/21-synth-pad/60.mp3': require('!arraybuffer-loader!./assets/instruments/21-synth-pad/60.mp3')
}; };

View file

@ -20,10 +20,6 @@ const nodeBuilder = new ScratchWebpackConfigBuilder(common)
name: 'VirtualMachine' name: 'VirtualMachine'
} }
} }
})
.addModuleRule({
test: /\.mp3$/,
type: 'asset'
}); });
const webBuilder = new ScratchWebpackConfigBuilder(common) const webBuilder = new ScratchWebpackConfigBuilder(common)
@ -43,10 +39,6 @@ const webBuilder = new ScratchWebpackConfigBuilder(common)
} }
} }
}) })
.addModuleRule({
test: /\.mp3$/,
type: 'asset'
})
.addModuleRule({ .addModuleRule({
test: require.resolve('./src/index.js'), test: require.resolve('./src/index.js'),
loader: 'expose-loader', loader: 'expose-loader',