Skip to content

Commit 047834e

Browse files
bcomnesjwerle
authored andcommitted
fix(): Fix DEP0130 warning
1 parent 09848ab commit 047834e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

loader.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ class Loader extends Pool {
135135
const contextModule = new Module(filename)
136136

137137
// istanbul ignore next
138-
const contextRequire = 'function' === typeof Module.createRequireFromPath
139-
? Module.createRequireFromPath(filename)
138+
const createRequireFromPath = Module.createRequire || Module.createRequireFromPath
139+
const contextRequire = 'function' === typeof createRequireFromPath
140+
? createRequireFromPath(filename)
140141
: makeRequireFunction(contextModule)
141142

142143
Object.assign(contextModule, {

0 commit comments

Comments
 (0)