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
feat: add comments abilities to require.context #13306
Conversation
For maintainers only:
|
Failure is a random fail in all pipelines on macOs https://dev.azure.com/webpack/webpack/_pipeline/analytics/stageawareoutcome?definitionId=3 |
Would love if this could be backported to Webpack 4... |
# Conflicts: # lib/dependencies/ImportParserPlugin.js # package.json
# Conflicts: # lib/dependencies/ImportParserPlugin.js # package.json
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
First somebody needs to review this PR for webpack 5 😅 |
What is use case? |
@alexander-akait Described in #9184 To be able to specify chunk names (and all other comment features) when using |
Why do not use |
Well, you can't match by regex with import, and you can't get a list of files, so localization is the best use case for require.context, for instance:
Because with this you can enumerate/iterate the available locales which import cannot do |
@alexander-akait , @Tofandel are there any updates on it ? There are quite a few use cases when you may need to dynamically load files by specific regex or with the dynamic value, like:
|
please use |
Fixes #9184 by adding the special comments feature from
import()
torequire.context()