Monday, 9 August 2021

Why is moment-timezone using a lot less space with webpack 4 and/or create react app 4?

With webpack 3, I was using moment-timezone-data-webpack-plugin to reduce my bundle size and it worked well. Tests showed it reduced the bundle size dramatically. I've now upgraded to webpack 4 and create-react-app 4, and it seems like

  1. this plugin has no impact on the total bundle size
  2. analyzing the bundle, moment-timezone only takes about 7k

As far as I can tell moment-timezone is functioning correctly in my app, so I'm very confused.

Webpack 4 is a lot better at reducing bundle size, but there's no way it can know which timezone data my app needs are runtime, so I can't imagine how that could be part of the answer.



from Why is moment-timezone using a lot less space with webpack 4 and/or create react app 4?

No comments:

Post a Comment