Webpack: bundle sounds as assets

public-report
Alex Gleason 2021-09-10 17:23:37 -05:00
rodzic 19181f40c3
commit 3359bda7f8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 4 dodań i 10 usunięć

Wyświetl plik

@ -1,8 +1,5 @@
'use strict';
import { join } from 'path';
import { FE_SUBDIRECTORY } from 'soapbox/build_config';
const createAudio = sources => {
const audio = new Audio();
sources.forEach(({ type, src }) => {
@ -31,21 +28,21 @@ export default function soundsMiddleware() {
const soundCache = {
boop: createAudio([
{
src: join(FE_SUBDIRECTORY, '/sounds/boop.ogg'),
src: require('../../sounds/boop.ogg'),
type: 'audio/ogg',
},
{
src: join(FE_SUBDIRECTORY, '/sounds/boop.mp3'),
src: require('../../sounds/boop.mp3'),
type: 'audio/mpeg',
},
]),
chat: createAudio([
{
src: join(FE_SUBDIRECTORY, '/sounds/chat.oga'),
src: require('../../sounds/chat.oga'),
type: 'audio/ogg',
},
{
src: join(FE_SUBDIRECTORY, '/sounds/chat.mp3'),
src: require('../../sounds/chat.mp3'),
type: 'audio/mpeg',
},
]),

Wyświetl plik

@ -89,9 +89,6 @@ module.exports = {
new HtmlWebpackHarddiskPlugin(),
new CopyPlugin({
patterns: [{
from: join(__dirname, '../app/sounds'),
to: join(output.path, 'sounds'),
}, {
from: join(__dirname, '../app/instance'),
to: join(output.path, 'instance'),
}],