browser: unhardcode rnnoise

This commit is contained in:
V 2023-09-21 18:19:59 +02:00
parent a82544e93e
commit 7e91edc757
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905
5 changed files with 10 additions and 35 deletions

View file

@ -57,6 +57,13 @@ const MonacoWorkerEntryPoints = [
"vs/editor/editor.worker.js"
];
const RnNoiseFiles = [
"dist/rnnoise.wasm",
"dist/rnnoise_simd.wasm",
"dist/rnnoise/workletProcessor.js",
"LICENSE"
];
await Promise.all(
[
esbuild.build({
@ -143,7 +150,9 @@ async function buildExtension(target, files) {
"dist/Vencord.js": await readFile("dist/extension.js"),
"dist/Vencord.css": await readFile("dist/extension.css"),
...await loadDir("dist/monaco"),
...await loadDir("browser/third-party", "browser/"),
...Object.fromEntries(await Promise.all(RnNoiseFiles.map(async file =>
[`third-party/rnnoise/${file.replace(/^dist\//, "")}`, await readFile(`node_modules/@sapphi-red/web-noise-suppressor/${file}`)]
))),
...Object.fromEntries(await Promise.all(files.map(async f => {
let content = await readFile(join("browser", f));
if (f.startsWith("manifest")) {