Skip to content

Commit

Permalink
reset module filename and paths
Browse files Browse the repository at this point in the history
  • Loading branch information
toyobayashi committed Jan 19, 2022
1 parent 56b05cf commit db60ec2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ function register () {
return Module._extensions['.js'](module, filename)
}
const filenameInAsar = resolveAsar(filename, null, module === require.main, filename)
module.filename = filenameInAsar
module.paths = Module._nodeModulePaths(path.dirname(filenameInAsar))
.map(p => p.replace(/\.asar\.unpacked([\\/])/g, '.asar$1'))
const ext = path.extname(filenameInAsar)
return Module._extensions[ext](module, filenameInAsar)
}
Expand Down

0 comments on commit db60ec2

Please sign in to comment.