I hacked this a bit. I have lodash and velocity-react . velocity-react depends on lodash@3.10.0 .
When I create my application using webpack 2, I get several errors like this:
Module not found: Error: Can't resolve 'lodash/object/extend'
However, if I change the version to 3.10.0 , it generates a lot of different errors for different packages, saying things like:
Module not found: Error: Can't resolve 'lodash/isObject'
It seems that the problem is that these libraries depend on different major versions of lodash. How to fix it?
EDITOR: I found a workaround, but that of course does not work a bit. I can add the following to my resolve.alias to fix it:
'lodash/object/omit': 'lodash/omit', 'lodash/object/extend': 'lodash/extend', 'lodash/lang/isObject': 'lodash/isObject', 'lodash/lang/isEqual': 'lodash/isEqual', 'lodash/collection/forEach': 'lodash/forEach', 'lodash/collection/each': 'lodash/each', 'lodash/collection/pluck': 'lodash/map', 'lodash/object/keys': 'lodash/keys',
But why should I do this? Of course, there should be a better solution.
javascript webpack
corvid
source share