Thursday 14 January 2016

How to require modules without specifying a path

I use browserify for the front-end which means that I sometimes share packages between the server and front-end. This means that my "Universal JS" libraries are separate from the rest of the code.Here's what my dir looks like:/lib //for universal /web //for front-end /server //for server now, whenever I'm deep in the front-end, going back to /lib is a pain. The requires pretty much look like ../../../lib/numberLib. Same with the server.Is there any way to specify custom aliased libraries so that I could just do numberLib and it'd require that specific library?

Submitted January 14, 2016 at 04:29PM by nostupidquestionsdev

No comments:

Post a Comment