Use concat for paths

This commit is contained in:
Jonathan Clem
2021-04-21 17:02:53 -04:00
parent c1c139b0ab
commit ade5cea985
2 changed files with 6 additions and 2 deletions

4
dist/index.js vendored
View File

@@ -2467,7 +2467,9 @@ const wrapRequire = new Proxy(require, {
return target.apply(thisArg, [moduleID]);
}
catch (err) {
return target.resolve(moduleID, { paths: [...module.paths, process.cwd()] });
return target.resolve(moduleID, {
paths: module.paths.concat(process.cwd())
});
}
},
get: (target, prop, receiver) => {

View File

@@ -10,7 +10,9 @@ export const wrapRequire = new Proxy(__non_webpack_require__, {
try {
return target.apply(thisArg, [moduleID])
} catch (err) {
return target.resolve(moduleID, {paths: [...module.paths, process.cwd()]})
return target.resolve(moduleID, {
paths: module.paths.concat(process.cwd())
})
}
},