troygoode / node-require-directory

Recursively iterates over specified directory, requiring each file, and returning a nested hash structure containing those libraries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does this play well with browserify?

olalonde opened this issue · comments

commented

Was wondering if this module breaks browserify builds?

I haven't tried it, but I suspect it'll work as it is just issuing a bunch of requires under the hood. Can you let us know how it goes?

require(s) works indeed, but I think fs.readDir does not work.
substack (browserify creator) made a companion plugin for bulk-require, that is called bulkify

That plugin basically does the reading of files part in node.js and then leaves the execution of require(s) to browser javascript.

Based on that plugin it can be made another small plugin to make browserify work with this project.

I am 👍 for this because substack has too many projects going on and bulkify/bulk-require have less options than this one and less maintenance