File tree 2 files changed +20
-27
lines changed 2 files changed +20
-27
lines changed Original file line number Diff line number Diff line change @@ -2899,20 +2899,16 @@ const wrapRequire = new Proxy(require, {
2899
2899
moduleID = path__WEBPACK_IMPORTED_MODULE_0__ . resolve ( moduleID ) ;
2900
2900
return target . apply ( thisArg , [ moduleID ] ) ;
2901
2901
}
2902
- try {
2903
- return target . apply ( thisArg , [ moduleID ] ) ;
2904
- }
2905
- catch ( err ) {
2906
- const modulePath = target . resolve . apply ( thisArg , [
2907
- moduleID ,
2908
- {
2909
- // Webpack does not have an escape hatch for getting the actual
2910
- // module, other than `eval`.
2911
- paths : eval ( 'module' ) . paths . concat ( process . cwd ( ) )
2912
- }
2913
- ] ) ;
2914
- return target . apply ( thisArg , [ modulePath ] ) ;
2915
- }
2902
+ const modulePath = target . resolve . apply ( thisArg , [
2903
+ moduleID ,
2904
+ {
2905
+ // Search the current working directory first, then the existing paths.
2906
+ // Webpack does not have an escape hatch for getting the actual
2907
+ // module, other than `eval`.
2908
+ paths : [ process . cwd ( ) , ...eval ( 'module' ) . paths ]
2909
+ }
2910
+ ] ) ;
2911
+ return target . apply ( thisArg , [ modulePath ] ) ;
2916
2912
} ,
2917
2913
get : ( target , prop , receiver ) => {
2918
2914
Reflect . get ( target , prop , receiver ) ;
Original file line number Diff line number Diff line change @@ -7,20 +7,17 @@ export const wrapRequire = new Proxy(__non_webpack_require__, {
7
7
return target . apply ( thisArg , [ moduleID ] )
8
8
}
9
9
10
- try {
11
- return target . apply ( thisArg , [ moduleID ] )
12
- } catch ( err ) {
13
- const modulePath = target . resolve . apply ( thisArg , [
14
- moduleID ,
15
- {
16
- // Webpack does not have an escape hatch for getting the actual
17
- // module, other than `eval`.
18
- paths : eval ( 'module' ) . paths . concat ( process . cwd ( ) )
19
- }
20
- ] )
10
+ const modulePath = target . resolve . apply ( thisArg , [
11
+ moduleID ,
12
+ {
13
+ // Search the current working directory first, then the existing paths.
14
+ // Webpack does not have an escape hatch for getting the actual
15
+ // module, other than `eval`.
16
+ paths : [ process . cwd ( ) , ...eval ( 'module' ) . paths ]
17
+ }
18
+ ] )
21
19
22
- return target . apply ( thisArg , [ modulePath ] )
23
- }
20
+ return target . apply ( thisArg , [ modulePath ] )
24
21
} ,
25
22
26
23
get : ( target , prop , receiver ) => {
You can’t perform that action at this time.
0 commit comments