From ecb2c1de25c84e4bc38b91f47dc28bb60d798702 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 4 Sep 2021 12:59:28 -0500 Subject: [PATCH] Subdirectory fixes: sounds, publicPath --- app/soapbox/middleware/sounds.js | 11 +++++++---- webpack/shared.js | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/soapbox/middleware/sounds.js b/app/soapbox/middleware/sounds.js index 12c857084..3486c0fb2 100644 --- a/app/soapbox/middleware/sounds.js +++ b/app/soapbox/middleware/sounds.js @@ -1,5 +1,8 @@ 'use strict'; +import { join } from 'path'; +import { FE_BASE_PATH } from 'soapbox/build_config'; + const createAudio = sources => { const audio = new Audio(); sources.forEach(({ type, src }) => { @@ -28,21 +31,21 @@ export default function soundsMiddleware() { const soundCache = { boop: createAudio([ { - src: '/sounds/boop.ogg', + src: join(FE_BASE_PATH, '/sounds/boop.ogg'), type: 'audio/ogg', }, { - src: '/sounds/boop.mp3', + src: join(FE_BASE_PATH, '/sounds/boop.mp3'), type: 'audio/mpeg', }, ]), chat: createAudio([ { - src: '/sounds/chat.oga', + src: join(FE_BASE_PATH, '/sounds/chat.oga'), type: 'audio/ogg', }, { - src: '/sounds/chat.mp3', + src: join(FE_BASE_PATH, '/sounds/chat.mp3'), type: 'audio/mpeg', }, ]), diff --git a/webpack/shared.js b/webpack/shared.js index ad790adba..817e91ebd 100644 --- a/webpack/shared.js +++ b/webpack/shared.js @@ -39,7 +39,7 @@ module.exports = { chunkFilename: 'packs/js/[name]-[chunkhash].chunk.js', hotUpdateChunkFilename: 'packs/js/[id]-[hash].hot-update.js', path: output.path, - publicPath: FE_BASE_PATH, + publicPath: join(FE_BASE_PATH, '/'), }, optimization: {