It feels hackier, and there is a downside: you can't alias non-relative modules because they are simply ignored. I've run into situations where I needed to alias something in node_modules because we preprocessed it and put it somewhere else.
But that works too!
I use the following regexp: /^[a-z\-0-9]+$/
Any reason to get the full module list over just using this regexp?