DEV Community

Anthony Frehner
Anthony Frehner

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

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)