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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay