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
|
|
@ -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