privatenumber / pkg-size.dev

📦🔍 Find the true size of an npm package
https://pkg-size.dev
688 stars 6 forks source link

Question: Minification Size for Different Environments #5

Closed jantimon closed 1 year ago

jantimon commented 1 year ago

Hi there!

I've been wondering about the minification size displayed on the website. As you may know, in a typical development setup, we often have different code sizes for development and production environments.

My question is whether pkg-size.dev takes into account the different minification sizes for code in different environments, specifically by using the process.env.NODE_ENV === "production" flag.

e.g. react:

shot-ZWMuZAUU

https://github.com/facebook/react/blob/9f4fbec5f7bb639be6dac438f9da5f032ae12c15/packages/react/npm/index.js#L1-L7

privatenumber commented 1 year ago

Good catch, thanks!

I think it makes sense to default to production mode (process.env.NODE_ENV="production").

Just pushed an update.

React now shows the production size: