aseemk / requireDir

Node.js helper to require() directories.
MIT License
484 stars 59 forks source link

If a directory and a file have the same basename only one gets processed #32

Closed fabiospampinato closed 7 years ago

fabiospampinato commented 8 years ago

Take a look at Semantic-UI's tasks folder: they have a build.js main task, that requires all the individual partial builders from the build directory, both are located at the same path.

I'm building something similar, but in a cleaner why with the help of this library. The problem is that since both objects have the same basename only the directory gets processed, hence the build.js file never gets loaded.

A possibile solution to this problem would be to overwrite the previously defined key of the returned hash, I think that processing all the files is more important. In my case none of the files located in the build directory is even actually exporting anything.

bondden commented 8 years ago

@fabiospampinato, have you tried setting duplicates option to true as it's described in Readme?

fabiospampinato commented 8 years ago

Setting duplicates to true works. I must have missed it, thanks!