ilearnio / module-alias

Register aliases of directories and custom module paths in Node
MIT License
1.76k stars 69 forks source link

Breaks `require.resolve` #53

Closed mikew closed 5 years ago

mikew commented 5 years ago

Looks like _resolveFilename actually takes 4 arguments:

> m._resolveFilename.toString()
'function(request, parent, isMain, options) ...'

Without passing that options argument, require.resolve(something, { paths: [] }) breaks.

I've made a sample repository here: https://github.com/mikew/module-alias-issue

Kehrlann commented 5 years ago

Fixed by #64