mirror of
https://github.com/actions/github-script.git
synced 2025-12-08 16:16:21 +00:00
Call resolve, then require
This commit is contained in:
8
dist/index.js
vendored
8
dist/index.js
vendored
@@ -2903,9 +2903,13 @@ const wrapRequire = new Proxy(require, {
|
|||||||
return target.apply(thisArg, [moduleID]);
|
return target.apply(thisArg, [moduleID]);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
return target.resolve(moduleID, {
|
const modulePath = target.resolve.apply(thisArg, [
|
||||||
|
moduleID,
|
||||||
|
{
|
||||||
paths: eval('module').paths.concat(process.cwd())
|
paths: eval('module').paths.concat(process.cwd())
|
||||||
});
|
}
|
||||||
|
]);
|
||||||
|
return target.apply(thisArg, [modulePath]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
get: (target, prop, receiver) => {
|
get: (target, prop, receiver) => {
|
||||||
|
|||||||
@@ -10,9 +10,14 @@ export const wrapRequire = new Proxy(__non_webpack_require__, {
|
|||||||
try {
|
try {
|
||||||
return target.apply(thisArg, [moduleID])
|
return target.apply(thisArg, [moduleID])
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return target.resolve(moduleID, {
|
const modulePath = target.resolve.apply(thisArg, [
|
||||||
|
moduleID,
|
||||||
|
{
|
||||||
paths: eval('module').paths.concat(process.cwd())
|
paths: eval('module').paths.concat(process.cwd())
|
||||||
})
|
}
|
||||||
|
])
|
||||||
|
|
||||||
|
return target.apply(thisArg, [modulePath])
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user