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
What is motivation or use case for adding/changing the behavior?
We are using aliases to make our client-side code use the ES Modules version of Lodash (lodash-es)—so that we get tree shaking—whilst the server-side code continues to use the old CommonJS version of Lodash (lodash). (Node does not yet support ES Modules.)
resolve: {alias: {lodash: 'lodash-es'}}
The downside to doing this is that aliases are applied globally, which means they will be applied to all modules including those inside node_modules (which could even need their own version of Lodash altogether).
How should this be implemented in your opinion?
It should be possible to scope aliases, just like you can with ES Modules’ import maps, e.g. this could look like:
Feature request
What is motivation or use case for adding/changing the behavior?
We are using aliases to make our client-side code use the ES Modules version of Lodash (
lodash-es
)—so that we get tree shaking—whilst the server-side code continues to use the old CommonJS version of Lodash (lodash
). (Node does not yet support ES Modules.)The downside to doing this is that aliases are applied globally, which means they will be applied to all modules including those inside
node_modules
(which could even need their own version of Lodash altogether).This behaviour actually caused a bug in our application: gaearon/react-hot-loader#1269
How should this be implemented in your opinion?
It should be possible to scope aliases, just like you can with ES Modules’ import maps, e.g. this could look like:
Are you willing to work on this yourself?
yes
The text was updated successfully, but these errors were encountered: