Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More fine-grained control of require.context() file search #1316

Closed
vjpr opened this issue Jul 31, 2015 · 3 comments
Closed

More fine-grained control of require.context() file search #1316

vjpr opened this issue Jul 31, 2015 · 3 comments

Comments

@vjpr
Copy link

vjpr commented Jul 31, 2015

Could we allow a maxDepth option for require.context to search for files, and perhaps an array of folders to search in?

If you set it to the root of your project it will end up running regexes against hundred of files, which is insanely slow.

My use case is a plugin system.

For my purposes, I have a /modules directory with lots of modules inside it. Each module has a config dir. E.g. /modules/foo/config/default.js. I want to collect all the files in the config dirs for each module, then merge them together to create a master config.

Also, could we allow absolute paths for directories?

@webpack-bot
Copy link
Contributor

This issue had no activity for at least half a year.

It's subject to automatic issue closing if there is no activity in the next 15 days.

@webpack-bot
Copy link
Contributor

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

@vjpr
Copy link
Author

vjpr commented Jan 18, 2018

To get around this I don't rely on require.context, instead manually code generating the require statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants