Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Using lodash-webpack-plugin breaks redux-persist functionality #54

Closed
creage opened this issue Aug 24, 2016 · 5 comments
Closed

Using lodash-webpack-plugin breaks redux-persist functionality #54

creage opened this issue Aug 24, 2016 · 5 comments
Labels

Comments

@creage
Copy link

creage commented Aug 24, 2016

I'm not sure if it is lodash's issue (probably not), but adding
new LodashModuleReplacementPlugin
to webpack plugins, causes redux-persist stopping write it's data to localStorage.

@jdalton
Copy link
Member

jdalton commented Aug 24, 2016

Hi @creage!

This plugin rewrites the module paths of lodash to remove feature sets and reduce extraneous functionality to create smaller bundles.

@rt2zz
Copy link

rt2zz commented Nov 1, 2016

This ended up being a strange issue that I never fully figured out:

lodash-webpack-plugin was somehow converting the forEach important to only handle forEach on arrays. Since we relied on collection iteration this broke things. I have since replaced that usage of forEach with an object.keys -> foreach call, but I am curious if anyone else comes across weird behavior like this.

@jdalton
Copy link
Member

jdalton commented Nov 1, 2016

Hi @rt2zz!

You need to enable the "collections" feature set.

@rt2zz
Copy link

rt2zz commented Nov 1, 2016

ah, @jdalton as a library author what would be the best way to "enforce" this? i.e. I cannot reasonably expect every consumer to know to set collections: true.

@jdalton
Copy link
Member

jdalton commented Nov 1, 2016

I cannot reasonably expect every consumer to know to set collections: true.

Folks should be consuming the bundled build.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants