You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constcache={};functionimportAll(r){r.keys().forEach((key)=>(cache[key]=r(key)));}importAll(require.context('../components/',true,/\.js$/));// At build-time cache will be populated with all required modules.
It means you can import a module using './thing.js' and 'test/things/thing.js', you can solve it by using regexp and exclude duplicate.
This was done intentionally. Changing this logic can break monorepos and will be the breaking change. Anyway feel free to feedback and questions.
Bug report
What is the current behavior?
When
require.context
is used in a module that has been discovered through an entry inresolve.modules
, the keys are duplicated.If the current behavior is a bug, please provide the steps to reproduce.
To reproduce this issue:
npm install
npm --silent start
You will see the output:
What is the expected behavior?
the correct output would be:
Other relevant information:
webpack version: 5.89.0
Node.js version:
Operating System:
Additional tools:
The text was updated successfully, but these errors were encountered: