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.:
NOTE: Created pull request https://github.com/ForbesLindesay/browserify-middleware/pull/19 for this issue. Should have done that first... sorry.
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.: