@@ -47,6 +47,11 @@ module.exports = (env, argv) => {
47
47
return {
48
48
...development ,
49
49
50
+ node : {
51
+ // Mock out the NodeFS module: The opus decoder imports this wrongly.
52
+ fs : 'empty' ,
53
+ } ,
54
+
50
55
entry : {
51
56
"bundle" : "./src/vector/index.ts" ,
52
57
"indexeddb-worker" : "./src/vector/indexeddb-worker.js" ,
@@ -278,6 +283,43 @@ module.exports = (env, argv) => {
278
283
outputPath : '.' ,
279
284
} ,
280
285
} ,
286
+ {
287
+ // This is from the same place as the encoderWorker above, but only needed
288
+ // for Safari support.
289
+ test : / d e c o d e r W o r k e r \. m i n \. j s $ / ,
290
+ loader : "file-loader" ,
291
+ type : "javascript/auto" , // https://github.com/webpack/webpack/issues/6725
292
+ options : {
293
+ // We deliberately override the name so it makes sense in debugging
294
+ name : 'opus-decoderWorker.min.[hash:7].[ext]' ,
295
+ outputPath : '.' ,
296
+ } ,
297
+ } ,
298
+ {
299
+ // This is from the same place as the encoderWorker above, but only needed
300
+ // for Safari support.
301
+ test : / d e c o d e r W o r k e r \. m i n \. w a s m $ / ,
302
+ loader : "file-loader" ,
303
+ type : "javascript/auto" , // https://github.com/webpack/webpack/issues/6725
304
+ options : {
305
+ // We deliberately don't change the name because the decoderWorker has this
306
+ // hardcoded. This is here to avoid the default wasm rule from adding a hash.
307
+ name : 'decoderWorker.min.wasm' ,
308
+ outputPath : '.' ,
309
+ } ,
310
+ } ,
311
+ {
312
+ // This is from the same place as the encoderWorker above, but only needed
313
+ // for Safari support.
314
+ test : / w a v e W o r k e r \. m i n \. j s $ / ,
315
+ loader : "file-loader" ,
316
+ type : "javascript/auto" , // https://github.com/webpack/webpack/issues/6725
317
+ options : {
318
+ // We deliberately override the name so it makes sense in debugging
319
+ name : 'wave-encoderWorker.min.[hash:7].[ext]' ,
320
+ outputPath : '.' ,
321
+ } ,
322
+ } ,
281
323
{
282
324
// cache-bust languages.json file placed in
283
325
// element-web/webapp/i18n during build by copy-res.js
0 commit comments