We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58141c6 commit 40dcc1fCopy full SHA for 40dcc1f
bindings.js
@@ -65,6 +65,9 @@ function bindings (opts) {
65
opts.bindings += '.node'
66
}
67
68
+ // https://github.com/webpack/webpack/issues/4175#issuecomment-342931035
69
+ var requireFunc = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require
70
+
71
var tries = []
72
, i = 0
73
, l = opts.try.length
@@ -78,7 +81,7 @@ function bindings (opts) {
78
81
}))
79
82
tries.push(n)
80
83
try {
- b = opts.path ? require.resolve(n) : require(n)
84
+ b = opts.path ? requireFunc.resolve(n) : requireFunc(n)
85
if (!opts.path) {
86
b.path = n
87
0 commit comments