dskrepps / requireFrom

Require from a directory relative to node_modules, flattening your require paths.
MIT License
47 stars 5 forks source link

Does this work with browserify? #1

Closed focusaurus closed 10 years ago

focusaurus commented 10 years ago

Found this via the gist comments on Better local require() paths for Node.js. Mostly this seems like the best available option, and I'm going to try it for my server side node code. My guess is the dynamic nature of the require path throws browserify for a loop. Wondering if you know already if that is or isn't the case.

dskrepps commented 10 years ago

Well, browserify can't dynamically require modules, so sadly it won't work. You could glob your modules and use b.require with the expose option, but then you might as well just do something like that without requireFrom at all.

I'll let you know if I find anything else though.