diff --git a/scripts/build/build.mjs b/scripts/build/build.mjs index 0d796ddb..7d21cd24 100755 --- a/scripts/build/build.mjs +++ b/scripts/build/build.mjs @@ -112,7 +112,7 @@ const buildConfigs = ([ ...nodeCommonOpts, entryPoints: ["src/main/index.ts"], outfile: "dist/patcher.js", - footer: { js: "//# sourceURL=VencordPatcher\n" + sourceMapFooter("patcher") }, + footer: { js: "//# sourceURL=file:///VencordPatcher\n" + sourceMapFooter("patcher") }, sourcemap, plugins: [ // @ts-ignore this is never undefined @@ -131,7 +131,7 @@ const buildConfigs = ([ outfile: "dist/renderer.js", format: "iife", target: ["esnext"], - footer: { js: "//# sourceURL=VencordRenderer\n" + sourceMapFooter("renderer") }, + footer: { js: "//# sourceURL=file:///VencordRenderer\n" + sourceMapFooter("renderer") }, globalName: "Vencord", sourcemap, plugins: [ @@ -148,7 +148,7 @@ const buildConfigs = ([ ...nodeCommonOpts, entryPoints: ["src/preload.ts"], outfile: "dist/preload.js", - footer: { js: "//# sourceURL=VencordPreload\n" + sourceMapFooter("preload") }, + footer: { js: "//# sourceURL=file:///VencordPreload\n" + sourceMapFooter("preload") }, sourcemap, define: { ...defines, @@ -162,7 +162,7 @@ const buildConfigs = ([ ...nodeCommonOpts, entryPoints: ["src/main/index.ts"], outfile: "dist/vencordDesktopMain.js", - footer: { js: "//# sourceURL=VencordDesktopMain\n" + sourceMapFooter("vencordDesktopMain") }, + footer: { js: "//# sourceURL=file:///VencordDesktopMain\n" + sourceMapFooter("vencordDesktopMain") }, sourcemap, plugins: [ ...nodeCommonOpts.plugins, @@ -180,7 +180,7 @@ const buildConfigs = ([ outfile: "dist/vencordDesktopRenderer.js", format: "iife", target: ["esnext"], - footer: { js: "//# sourceURL=VencordDesktopRenderer\n" + sourceMapFooter("vencordDesktopRenderer") }, + footer: { js: "//# sourceURL=file:///VencordDesktopRenderer\n" + sourceMapFooter("vencordDesktopRenderer") }, globalName: "Vencord", sourcemap, plugins: [ @@ -197,7 +197,7 @@ const buildConfigs = ([ ...nodeCommonOpts, entryPoints: ["src/preload.ts"], outfile: "dist/vencordDesktopPreload.js", - footer: { js: "//# sourceURL=VencordPreload\n" + sourceMapFooter("vencordDesktopPreload") }, + footer: { js: "//# sourceURL=file:///VencordPreload\n" + sourceMapFooter("vencordDesktopPreload") }, sourcemap, define: { ...defines, diff --git a/scripts/build/buildWeb.mjs b/scripts/build/buildWeb.mjs index 33168ff9..824194cf 100644 --- a/scripts/build/buildWeb.mjs +++ b/scripts/build/buildWeb.mjs @@ -82,7 +82,7 @@ const buildConfigs = [ { ...commonOptions, outfile: "dist/browser.js", - footer: { js: "//# sourceURL=VencordWeb" } + footer: { js: "//# sourceURL=file:///VencordWeb" } }, { ...commonOptions, @@ -91,7 +91,7 @@ const buildConfigs = [ ...commonOptions.define, IS_EXTENSION: "true" }, - footer: { js: "//# sourceURL=VencordWeb" } + footer: { js: "//# sourceURL=file:///VencordWeb" } }, { ...commonOptions, diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index 7d30ee1f..72effca5 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -581,7 +581,7 @@ function patchFactory(moduleId: PropertyKey, originalFactory: AnyModuleFactory): } code = newCode; - patchedSource = `// Webpack Module ${String(moduleId)} - Patched by ${pluginsList.join(", ")}\n${newCode}\n//# sourceURL=WebpackModule${String(moduleId)}`; + patchedSource = `// Webpack Module ${String(moduleId)} - Patched by ${pluginsList.join(", ")}\n${newCode}\n//# sourceURL=file:///WebpackModule${String(moduleId)}`; patchedFactory = (0, eval)(patchedSource); if (!patchedBy.has(patch.plugin)) { diff --git a/src/webpack/webpack.ts b/src/webpack/webpack.ts index bce50f3d..ec9e99be 100644 --- a/src/webpack/webpack.ts +++ b/src/webpack/webpack.ts @@ -751,7 +751,7 @@ export function extract(id: string | number) { // This module is NOT ACTUALLY USED! This means putting breakpoints will have NO EFFECT!! 0,${mod.toString()} -//# sourceURL=ExtractedWebpackModule${id} +//# sourceURL=file:///ExtractedWebpackModule${id} `; const extracted = (0, eval)(code); return extracted as Function;