aseemk / requireDir

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

Can't import file and folder with the same name #16

Closed kdela closed 9 years ago

kdela commented 9 years ago

Hi. I just tried import files from folder recursively, and unfortunately my folders have name conflict with another files.

├── build │   ├── clean.js ├── build.js ├── default.js ├── dev │   ├── browserSync.js └── dev.js

With this example files 'build.js' and 'dev.js' wont be loaded.

aseemk commented 9 years ago

It should work with duplicates: true (along with recurse: true still).

Feel free to re-open if it doesn't.

kdela commented 9 years ago

I wondering why It's not a default behaviour. Anyway, It's obviously working now, thank you @aseemk!

aseemk commented 9 years ago

To mimic Node's native require: if you have a build directory alongside build.js, require('./build') will require the directory, not the file. =) No prob!