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

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay