Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7e12bd7

Browse filesBrowse files
committed
Call resolve, then require
1 parent 7e8659d commit 7e12bd7
Copy full SHA for 7e12bd7

File tree

Expand file treeCollapse file tree

2 files changed

+15
-6
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+15
-6
lines changed

‎dist/index.js

Copy file name to clipboardExpand all lines: dist/index.js
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2903,9 +2903,13 @@ const wrapRequire = new Proxy(require, {
29032903
return target.apply(thisArg, [moduleID]);
29042904
}
29052905
catch (err) {
2906-
return target.resolve(moduleID, {
2907-
paths: eval('module').paths.concat(process.cwd())
2908-
});
2906+
const modulePath = target.resolve.apply(thisArg, [
2907+
moduleID,
2908+
{
2909+
paths: eval('module').paths.concat(process.cwd())
2910+
}
2911+
]);
2912+
return target.apply(thisArg, [modulePath]);
29092913
}
29102914
},
29112915
get: (target, prop, receiver) => {

‎src/wrap-require.ts

Copy file name to clipboardExpand all lines: src/wrap-require.ts
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@ export const wrapRequire = new Proxy(__non_webpack_require__, {
1010
try {
1111
return target.apply(thisArg, [moduleID])
1212
} catch (err) {
13-
return target.resolve(moduleID, {
14-
paths: eval('module').paths.concat(process.cwd())
15-
})
13+
const modulePath = target.resolve.apply(thisArg, [
14+
moduleID,
15+
{
16+
paths: eval('module').paths.concat(process.cwd())
17+
}
18+
])
19+
20+
return target.apply(thisArg, [modulePath])
1621
}
1722
},
1823

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.