Subdirectory fixes: sounds, publicPath
This commit is contained in:
parent
f27fbc1c38
commit
ecb2c1de25
|
@ -1,5 +1,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
import { join } from 'path';
|
||||||
|
import { FE_BASE_PATH } from 'soapbox/build_config';
|
||||||
|
|
||||||
const createAudio = sources => {
|
const createAudio = sources => {
|
||||||
const audio = new Audio();
|
const audio = new Audio();
|
||||||
sources.forEach(({ type, src }) => {
|
sources.forEach(({ type, src }) => {
|
||||||
|
@ -28,21 +31,21 @@ export default function soundsMiddleware() {
|
||||||
const soundCache = {
|
const soundCache = {
|
||||||
boop: createAudio([
|
boop: createAudio([
|
||||||
{
|
{
|
||||||
src: '/sounds/boop.ogg',
|
src: join(FE_BASE_PATH, '/sounds/boop.ogg'),
|
||||||
type: 'audio/ogg',
|
type: 'audio/ogg',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: '/sounds/boop.mp3',
|
src: join(FE_BASE_PATH, '/sounds/boop.mp3'),
|
||||||
type: 'audio/mpeg',
|
type: 'audio/mpeg',
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
chat: createAudio([
|
chat: createAudio([
|
||||||
{
|
{
|
||||||
src: '/sounds/chat.oga',
|
src: join(FE_BASE_PATH, '/sounds/chat.oga'),
|
||||||
type: 'audio/ogg',
|
type: 'audio/ogg',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: '/sounds/chat.mp3',
|
src: join(FE_BASE_PATH, '/sounds/chat.mp3'),
|
||||||
type: 'audio/mpeg',
|
type: 'audio/mpeg',
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
|
|
|
@ -39,7 +39,7 @@ module.exports = {
|
||||||
chunkFilename: 'packs/js/[name]-[chunkhash].chunk.js',
|
chunkFilename: 'packs/js/[name]-[chunkhash].chunk.js',
|
||||||
hotUpdateChunkFilename: 'packs/js/[id]-[hash].hot-update.js',
|
hotUpdateChunkFilename: 'packs/js/[id]-[hash].hot-update.js',
|
||||||
path: output.path,
|
path: output.path,
|
||||||
publicPath: FE_BASE_PATH,
|
publicPath: join(FE_BASE_PATH, '/'),
|
||||||
},
|
},
|
||||||
|
|
||||||
optimization: {
|
optimization: {
|
||||||
|
|
Loading…
Reference in New Issue