Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ade5cea

Browse files
committed
Use concat for paths
1 parent c1c139b commit ade5cea

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

dist/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2467,7 +2467,9 @@ const wrapRequire = new Proxy(require, {
24672467
return target.apply(thisArg, [moduleID]);
24682468
}
24692469
catch (err) {
2470-
return target.resolve(moduleID, { paths: [...module.paths, process.cwd()] });
2470+
return target.resolve(moduleID, {
2471+
paths: module.paths.concat(process.cwd())
2472+
});
24712473
}
24722474
},
24732475
get: (target, prop, receiver) => {

src/wrap-require.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export const wrapRequire = new Proxy(__non_webpack_require__, {
1010
try {
1111
return target.apply(thisArg, [moduleID])
1212
} catch (err) {
13-
return target.resolve(moduleID, {paths: [...module.paths, process.cwd()]})
13+
return target.resolve(moduleID, {
14+
paths: module.paths.concat(process.cwd())
15+
})
1416
}
1517
},
1618

0 commit comments

Comments
 (0)