upd: make the mod tracker work in dev mode
this is an ugly hack but it's a ugly hack that works.
This commit is contained in:
parent
8702c1dd24
commit
f58f0eaf92
3 changed files with 10 additions and 1 deletions
|
|
@ -233,7 +233,14 @@ export class ChiptuneJsPlayer {
|
|||
async createLibopenmptNode(buffer: ArrayBuffer) {
|
||||
if (!this.libopenmpt) {
|
||||
const libopenmpt = await import('libopenmpt-wasm');
|
||||
this.libopenmpt = await libopenmpt.default();
|
||||
this.libopenmpt = await libopenmpt.default( _DEV_ ? {
|
||||
// hack to make libopenmpt load in dev mode
|
||||
locateFile(file) {
|
||||
const url = new URL(window.location.href);
|
||||
url.pathname = `/@fs/${__DIRNAME__}/node_modules/libopenmpt-wasm/${file}`;
|
||||
return url.href;
|
||||
},
|
||||
} : {});
|
||||
}
|
||||
|
||||
return new ChiptuneProcessorNode(this, buffer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue