From 47eec049fc98548846554115016ca7a220f9af6b Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Fri, 31 May 2024 00:21:15 -0300 Subject: [PATCH] Not needed anymore and breaks interpolated strings with newlines --- src/webpack/patchWebpack.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index ffc4100e0..d728e5a2f 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -211,16 +211,8 @@ function patchFactory(id: PropertyKey, factory: ModuleFactory) { const patchedBy = new Set(); - // Discords Webpack chunks for some ungodly reason contain random - // newlines. Cyn recommended this workaround and it seems to work fine, - // however this could potentially break code, so if anything goes weird, - // this is probably why. - // Additionally, `[actual newline]` is one less char than "\n", so if Discord - // ever targets newer browsers, the minifier could potentially use this trick and - // cause issues. - // - // 0, prefix is to turn it into an expression: 0,function(){} would be invalid syntax without the 0, - let code: string = "0," + String(factory).replaceAll("\n", ""); + // 0, prefix to turn it into an expression: 0,function(){} would be invalid syntax without the 0, + let code: string = "0," + String(factory); for (let i = 0; i < patches.length; i++) { const patch = patches[i];