DEV Community

Discussion on: I reduced an npm package size by 50% with minification

 
seven profile image
Caleb!

Great! Thank you for pointing this out too. 🚀

Thread Thread
 
seven profile image
Caleb!

Just to be clear again...

It'll be better to do something like

import React from "skypack/link/that/points-to-the-react-package" 
Enter fullscreen mode Exit fullscreen mode

Instead of the normal way. Yeah?

@jonrandy

Thread Thread
 
dagnelies profile image
Arnaud Dagnelies • Edited

It depends. If you pull a library "from the browser", it is preferable to be minified. If you pull a library "in your npm project", the sources are often preferable, since the whole app is bundled/minified in the end anyway.

Thread Thread
 
seven profile image
Caleb!

Now, this is clear.

Thank you! 🍷