mirror of
https://github.com/actions/github-script.git
synced 2025-12-09 20:36:20 +00:00
Search the cwd first, then existing module paths
This commit is contained in:
24
dist/index.js
vendored
24
dist/index.js
vendored
@@ -2899,20 +2899,16 @@ const wrapRequire = new Proxy(require, {
|
|||||||
moduleID = path__WEBPACK_IMPORTED_MODULE_0__.resolve(moduleID);
|
moduleID = path__WEBPACK_IMPORTED_MODULE_0__.resolve(moduleID);
|
||||||
return target.apply(thisArg, [moduleID]);
|
return target.apply(thisArg, [moduleID]);
|
||||||
}
|
}
|
||||||
try {
|
const modulePath = target.resolve.apply(thisArg, [
|
||||||
return target.apply(thisArg, [moduleID]);
|
moduleID,
|
||||||
}
|
{
|
||||||
catch (err) {
|
// Search the current working directory first, then the existing paths.
|
||||||
const modulePath = target.resolve.apply(thisArg, [
|
// Webpack does not have an escape hatch for getting the actual
|
||||||
moduleID,
|
// module, other than `eval`.
|
||||||
{
|
paths: [process.cwd(), ...eval('module').paths]
|
||||||
// Webpack does not have an escape hatch for getting the actual
|
}
|
||||||
// module, other than `eval`.
|
]);
|
||||||
paths: eval('module').paths.concat(process.cwd())
|
return target.apply(thisArg, [modulePath]);
|
||||||
}
|
|
||||||
]);
|
|
||||||
return target.apply(thisArg, [modulePath]);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
get: (target, prop, receiver) => {
|
get: (target, prop, receiver) => {
|
||||||
Reflect.get(target, prop, receiver);
|
Reflect.get(target, prop, receiver);
|
||||||
|
|||||||
@@ -7,20 +7,17 @@ export const wrapRequire = new Proxy(__non_webpack_require__, {
|
|||||||
return target.apply(thisArg, [moduleID])
|
return target.apply(thisArg, [moduleID])
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
const modulePath = target.resolve.apply(thisArg, [
|
||||||
return target.apply(thisArg, [moduleID])
|
moduleID,
|
||||||
} catch (err) {
|
{
|
||||||
const modulePath = target.resolve.apply(thisArg, [
|
// Search the current working directory first, then the existing paths.
|
||||||
moduleID,
|
// Webpack does not have an escape hatch for getting the actual
|
||||||
{
|
// module, other than `eval`.
|
||||||
// Webpack does not have an escape hatch for getting the actual
|
paths: [process.cwd(), ...eval('module').paths]
|
||||||
// module, other than `eval`.
|
}
|
||||||
paths: eval('module').paths.concat(process.cwd())
|
])
|
||||||
}
|
|
||||||
])
|
|
||||||
|
|
||||||
return target.apply(thisArg, [modulePath])
|
return target.apply(thisArg, [modulePath])
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
get: (target, prop, receiver) => {
|
get: (target, prop, receiver) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user