-
Notifications
You must be signed in to change notification settings - Fork 801
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
Using lodash-es #1269
Comments
One suggestion would be to ship an esm version of the library linked to under "module" entry. |
For now, this workaround works: if (!options.production) {
config.resolve.alias['lodash/merge'] = path.dirname(require.resolve('lodash/merge'))
}
config.resolve.alias['lodash'] = path.dirname(require.resolve('lodash-es')) |
Would you accept a PR that removes the use of lodash and replaces lodash/merge with something inline. |
With pleasure :) |
I'm wondering the following error is related to this issue: ERROR in ./node_modules/react-hot-loader/dist/react-hot-loader.development.js
Module not found: Error: Can't resolve 'lodash/merge' in '/Users/mcrunix/w/phizog/node_modules/react-hot-loader/dist'
@ ./node_modules/react-hot-loader/dist/react-hot-loader.development.js 1057:12-35
@ ./node_modules/react-hot-loader/patch.js
@ multi react-hot-loader/patch webpack-hot-middleware/client?path=http://localhost:3000/__webpack_hmr&reload=true ./app/index Also i had test @KidkArolis workaround but didn't work. |
The best solution would be to get rid of |
I'm not familiar with the logic of RHL proxy as the following but in case of merging objects you have spreading operator or import merge lib in es6 way
|
It's more about - this code is really not needed anymore. |
Just another point, I feel it'd be great to consider a stable tag to not release all versions on NPM. Every time i tried to run my project for a 1-2 month period i got an error which related to react-hot-loader. |
Should be fixed in 4.12.4
|
I also just ran into this. You can fix it by scoping the webpack alias to exclude |
If you configure a lodash alias in webpack:
RHL fails with:
Because
const merge = require('lodash-es/merge')
results in{ default: merge }
.Haven't figured out how to workaround this yet.
The text was updated successfully, but these errors were encountered: