in my webpack config
when
mode: "development"
if I use
import { pick, flattenDeep, chunk, fromPairs } from 'lodash-es';
or
import _ from 'lodash-es';
the bundle size is the same at about 3.27 mb.
but when I set mode to production in my webpack config, I get a bundle size of 1.52mb for the first import syntax, but I get 2.5mb for the second syntax, which leads my to believe that in development the tree shaking is not occuring.
I read on another stack overflow question that the lodash-es was an es6 module and that webpack could only tree shake on those, and not common js, and I also read that in development for the webpack config I would need
plugins: [
new webpack.optimize.ModuleConcatenationPlugin()
],
which I have had the whole time.
So I am curious what I am missing and why the bundle size is not reduced in development when using that plugin mentioned.
I am experimenting these changes in an example project I created at https://github.com/JordanKlaers/vueWebpackPlayground