Add Webpack comment vis-a-vis eval

This commit is contained in:
Jonathan Clem 2021-04-21 17:12:21 -04:00
parent 7e12bd7395
commit b0e12e725b
No known key found for this signature in database
GPG key ID: 2159A758355F0178
2 changed files with 4 additions and 0 deletions

2
dist/index.js vendored
View file

@ -2906,6 +2906,8 @@ const wrapRequire = new Proxy(require, {
const modulePath = target.resolve.apply(thisArg, [ const modulePath = target.resolve.apply(thisArg, [
moduleID, moduleID,
{ {
// Webpack does not have an escape hatch for getting the actual
// module, other than `eval`.
paths: eval('module').paths.concat(process.cwd()) paths: eval('module').paths.concat(process.cwd())
} }
]); ]);

View file

@ -13,6 +13,8 @@ export const wrapRequire = new Proxy(__non_webpack_require__, {
const modulePath = target.resolve.apply(thisArg, [ const modulePath = target.resolve.apply(thisArg, [
moduleID, moduleID,
{ {
// Webpack does not have an escape hatch for getting the actual
// module, other than `eval`.
paths: eval('module').paths.concat(process.cwd()) paths: eval('module').paths.concat(process.cwd())
} }
]) ])