mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 13:43:03 -04:00
Fix jumping to patched module source for new React Dev Tools (#3418)
This commit is contained in:
parent
c2e5dcc384
commit
8023b1be95
4 changed files with 10 additions and 10 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue