It doesn't work when using the alias as the root of the import
Tiagoperes opened this issue · 0 comments
Tiagoperes commented
require("alias/file")
works fine, but if you have an index file under the alias and reference only require("alias")
, it doesn't work. Imports to the root of an alias never gets replaced.
From what I see, this project has been abandoned, if anyone goes through the same problem, you need to replace the line 105 in this file for:
if (modulePath.startsWith(prefix) || modulePath === prefix.replace(/\/$/, '')) {