From b0e12e725ba5182c4b0cb8c2bf2ca0f25097754b Mon Sep 17 00:00:00 2001 From: Jonathan Clem Date: Wed, 21 Apr 2021 17:12:21 -0400 Subject: [PATCH] Add Webpack comment vis-a-vis eval --- dist/index.js | 2 ++ src/wrap-require.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/dist/index.js b/dist/index.js index 159c7c5..19a3102 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2906,6 +2906,8 @@ const wrapRequire = new Proxy(require, { const modulePath = target.resolve.apply(thisArg, [ moduleID, { + // Webpack does not have an escape hatch for getting the actual + // module, other than `eval`. paths: eval('module').paths.concat(process.cwd()) } ]); diff --git a/src/wrap-require.ts b/src/wrap-require.ts index de15f6e..22311d9 100644 --- a/src/wrap-require.ts +++ b/src/wrap-require.ts @@ -13,6 +13,8 @@ export const wrapRequire = new Proxy(__non_webpack_require__, { const modulePath = target.resolve.apply(thisArg, [ moduleID, { + // Webpack does not have an escape hatch for getting the actual + // module, other than `eval`. paths: eval('module').paths.concat(process.cwd()) } ])