I have an application structure where the express server is being instantiated in a different module from the handlers and the handlers are injected. Basically something like this:
Because the module search is relative to __dirname of the caller (which in fact is the module that creates the express-app) browserify-middleware isn't able to pull in the browser dependencies from the other branch.
A "basedir"-option on the browserify() call would solve that problem, e.g.:
I'm not convinced this is needed. Your dependencies should be in a node_modules folder at the top level scope. If they are, they should be found by the resolution algorithm.
I have an application structure where the express server is being instantiated in a different module from the handlers and the handlers are injected. Basically something like this:
Because the module search is relative to
__dirname
of the caller (which in fact is the module that creates the express-app) browserify-middleware isn't able to pull in the browser dependencies from the other branch.A "basedir"-option on the browserify() call would solve that problem, e.g.: