In your file ToasterContainer.js, you are importing lodash like thisimport _ from "lodash", but you seem to only be using the omit function. This causes webpack bundles requiring react-toastr to be unnecessarily large. lodash.js is about ~500kb. You can just require the function directly e.g. import _omit from "lodash/omit". This will greatly reduce the bundle size.
I am pointing this out because I am using react-bootstrap-table, which depends on react-toastr and noticed that even though I am only using 2 lodash functions, webpack was pulling in the entire library. I was able to trace it back to react-toastr.
Hi,
In your file
ToasterContainer.js
, you are importing lodash like thisimport _ from "lodash"
, but you seem to only be using the omit function. This causes webpack bundles requiring react-toastr to be unnecessarily large. lodash.js is about ~500kb. You can just require the function directly e.g.import _omit from "lodash/omit"
. This will greatly reduce the bundle size.I am pointing this out because I am using react-bootstrap-table, which depends on react-toastr and noticed that even though I am only using 2 lodash functions, webpack was pulling in the entire library. I was able to trace it back to react-toastr.
Thanks.