Closed simon-p-r closed 6 years ago
There doesn't seem to be an option for that, but luckily both of your example cases should be handled already. require-dir
actively ignores node_modules
. And the strategy it uses for determining basenames (removes extensions), should lead to an empty string for anything starting with .
, which hopefully wouldn't get required or end up in the result list, but I haven't tested that.
I guess you could do something like this: .src(['!./src/js/*/.test.js', './src/js/*/.js'])
you just tell the array not to take the test files in this case. in your case would be something like:
.src["!./.git", "!./node_modules"]
done, will be published in next npm release
Hi anything on this ?
@sunnixx This has been published already, see the README https://github.com/aseemk/requireDir#options
Hi
Is there no option to filter out directories you don't want to require? Folders such as .git or node_modules are 2 directories you may want to filter from a directory require.