DEV Community

Anthony Frehner
Anthony Frehner

Posted on • Edited on • Originally published at github.com

1

The Modern Guide to Packaging Your JavaScript Library

I had a lot of questions when it came to packaging up my JavaScript library, such as:

  • minify?
  • output to single file or maintain file/folder structure?
  • have an esm build (or cjs)?
  • transpile or not? (e.g. jsx -> createElement)
  • package.exports setup?
  • other package.json settings? (e.g. type)
  • multiple outputs - dev/prod?
  • what is "double bundling"?

With the hope of answering these questions, and more, I created the Modern Guide to Packaging Your JavaScript Library.

I created it on GitHub so that, as time goes on, it will (hopefully) remain fresh and updated - if I had written it as an article, then no one else could have contributed as easily, and it may have gone stale.

Hopefully this guide is helpful to you, too.

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay