const Module = require(`module`)
const path = require(`path`)

// Polyfill Node's `Module.createRequireFromPath` if not present (added in Node v10.12.0)
module.exports =
  Module.createRequireFromPath ||
  function(filename) {
    const mod = new Module(filename, null)

    mod.filename = filename
    mod.paths = Module._nodeModulePaths(path.dirname(filename))
    mod._compile(`module.exports = require;`, filename)

    return mod.exports
  }

@@ -163,16 +163,42 @@
 ports =%0A
+  Module.createRequire %7C%7C%0A
   Module

Fix createRequireFromPath deprecation warning (#19677)