mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 06:03: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,
|
...nodeCommonOpts,
|
||||||
entryPoints: ["src/main/index.ts"],
|
entryPoints: ["src/main/index.ts"],
|
||||||
outfile: "dist/patcher.js",
|
outfile: "dist/patcher.js",
|
||||||
footer: { js: "//# sourceURL=VencordPatcher\n" + sourceMapFooter("patcher") },
|
footer: { js: "//# sourceURL=file:///VencordPatcher\n" + sourceMapFooter("patcher") },
|
||||||
sourcemap,
|
sourcemap,
|
||||||
plugins: [
|
plugins: [
|
||||||
// @ts-ignore this is never undefined
|
// @ts-ignore this is never undefined
|
||||||
|
@ -131,7 +131,7 @@ const buildConfigs = ([
|
||||||
outfile: "dist/renderer.js",
|
outfile: "dist/renderer.js",
|
||||||
format: "iife",
|
format: "iife",
|
||||||
target: ["esnext"],
|
target: ["esnext"],
|
||||||
footer: { js: "//# sourceURL=VencordRenderer\n" + sourceMapFooter("renderer") },
|
footer: { js: "//# sourceURL=file:///VencordRenderer\n" + sourceMapFooter("renderer") },
|
||||||
globalName: "Vencord",
|
globalName: "Vencord",
|
||||||
sourcemap,
|
sourcemap,
|
||||||
plugins: [
|
plugins: [
|
||||||
|
@ -148,7 +148,7 @@ const buildConfigs = ([
|
||||||
...nodeCommonOpts,
|
...nodeCommonOpts,
|
||||||
entryPoints: ["src/preload.ts"],
|
entryPoints: ["src/preload.ts"],
|
||||||
outfile: "dist/preload.js",
|
outfile: "dist/preload.js",
|
||||||
footer: { js: "//# sourceURL=VencordPreload\n" + sourceMapFooter("preload") },
|
footer: { js: "//# sourceURL=file:///VencordPreload\n" + sourceMapFooter("preload") },
|
||||||
sourcemap,
|
sourcemap,
|
||||||
define: {
|
define: {
|
||||||
...defines,
|
...defines,
|
||||||
|
@ -162,7 +162,7 @@ const buildConfigs = ([
|
||||||
...nodeCommonOpts,
|
...nodeCommonOpts,
|
||||||
entryPoints: ["src/main/index.ts"],
|
entryPoints: ["src/main/index.ts"],
|
||||||
outfile: "dist/vencordDesktopMain.js",
|
outfile: "dist/vencordDesktopMain.js",
|
||||||
footer: { js: "//# sourceURL=VencordDesktopMain\n" + sourceMapFooter("vencordDesktopMain") },
|
footer: { js: "//# sourceURL=file:///VencordDesktopMain\n" + sourceMapFooter("vencordDesktopMain") },
|
||||||
sourcemap,
|
sourcemap,
|
||||||
plugins: [
|
plugins: [
|
||||||
...nodeCommonOpts.plugins,
|
...nodeCommonOpts.plugins,
|
||||||
|
@ -180,7 +180,7 @@ const buildConfigs = ([
|
||||||
outfile: "dist/vencordDesktopRenderer.js",
|
outfile: "dist/vencordDesktopRenderer.js",
|
||||||
format: "iife",
|
format: "iife",
|
||||||
target: ["esnext"],
|
target: ["esnext"],
|
||||||
footer: { js: "//# sourceURL=VencordDesktopRenderer\n" + sourceMapFooter("vencordDesktopRenderer") },
|
footer: { js: "//# sourceURL=file:///VencordDesktopRenderer\n" + sourceMapFooter("vencordDesktopRenderer") },
|
||||||
globalName: "Vencord",
|
globalName: "Vencord",
|
||||||
sourcemap,
|
sourcemap,
|
||||||
plugins: [
|
plugins: [
|
||||||
|
@ -197,7 +197,7 @@ const buildConfigs = ([
|
||||||
...nodeCommonOpts,
|
...nodeCommonOpts,
|
||||||
entryPoints: ["src/preload.ts"],
|
entryPoints: ["src/preload.ts"],
|
||||||
outfile: "dist/vencordDesktopPreload.js",
|
outfile: "dist/vencordDesktopPreload.js",
|
||||||
footer: { js: "//# sourceURL=VencordPreload\n" + sourceMapFooter("vencordDesktopPreload") },
|
footer: { js: "//# sourceURL=file:///VencordPreload\n" + sourceMapFooter("vencordDesktopPreload") },
|
||||||
sourcemap,
|
sourcemap,
|
||||||
define: {
|
define: {
|
||||||
...defines,
|
...defines,
|
||||||
|
|
|
@ -82,7 +82,7 @@ const buildConfigs = [
|
||||||
{
|
{
|
||||||
...commonOptions,
|
...commonOptions,
|
||||||
outfile: "dist/browser.js",
|
outfile: "dist/browser.js",
|
||||||
footer: { js: "//# sourceURL=VencordWeb" }
|
footer: { js: "//# sourceURL=file:///VencordWeb" }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
...commonOptions,
|
...commonOptions,
|
||||||
|
@ -91,7 +91,7 @@ const buildConfigs = [
|
||||||
...commonOptions.define,
|
...commonOptions.define,
|
||||||
IS_EXTENSION: "true"
|
IS_EXTENSION: "true"
|
||||||
},
|
},
|
||||||
footer: { js: "//# sourceURL=VencordWeb" }
|
footer: { js: "//# sourceURL=file:///VencordWeb" }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
...commonOptions,
|
...commonOptions,
|
||||||
|
|
|
@ -581,7 +581,7 @@ function patchFactory(moduleId: PropertyKey, originalFactory: AnyModuleFactory):
|
||||||
}
|
}
|
||||||
|
|
||||||
code = newCode;
|
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);
|
patchedFactory = (0, eval)(patchedSource);
|
||||||
|
|
||||||
if (!patchedBy.has(patch.plugin)) {
|
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!!
|
// This module is NOT ACTUALLY USED! This means putting breakpoints will have NO EFFECT!!
|
||||||
|
|
||||||
0,${mod.toString()}
|
0,${mod.toString()}
|
||||||
//# sourceURL=ExtractedWebpackModule${id}
|
//# sourceURL=file:///ExtractedWebpackModule${id}
|
||||||
`;
|
`;
|
||||||
const extracted = (0, eval)(code);
|
const extracted = (0, eval)(code);
|
||||||
return extracted as Function;
|
return extracted as Function;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue