File tree Expand file tree Collapse file tree 2 files changed +20
-27
lines changed Expand file tree Collapse file tree 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, {
28992899 moduleID = path__WEBPACK_IMPORTED_MODULE_0__ . resolve ( moduleID ) ;
29002900 return target . apply ( thisArg , [ moduleID ] ) ;
29012901 }
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 ] ) ;
29162912 } ,
29172913 get : ( target , prop , receiver ) => {
29182914 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__, {
77 return target . apply ( thisArg , [ moduleID ] )
88 }
99
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+ ] )
2119
22- return target . apply ( thisArg , [ modulePath ] )
23- }
20+ return target . apply ( thisArg , [ modulePath ] )
2421 } ,
2522
2623 get : ( target , prop , receiver ) => {
You can’t perform that action at this time.
0 commit comments