2

Recently I published a humble package in npm. After then, I found unpacked size item in npm website.

I thought my package is small and simple. but unpacked size is nearly 2mb Shocked, I tried Bundlephobia and It said my package is 12.2kb

And now I'm so confused, what unpackes size in npm really means?


I found a STO question related about this. but I can't understand early.

SpookyJelly
  • 105
  • 10

1 Answers1

0

'unpacked size' is the size of all the stuff you're downloading when installing an npm package. the code in this package will not be minified, it will include comments for the IDE and most likely type declarations.

'bundle size' is the size of the npm package after being bundled using a module bundler like webpack, so it's the actual size of the package in a production build.

so - for development you have to download this 3mb package, but after building your app the user will only have to download extra 12kb of code

remonke
  • 251
  • 3
  • 6