Output module formats

Generate bundles in popular module formats

Person in labcoat walking left


When building JavaScript for Node.js, bundles must be made available in the CommonJS format. As of Node 12, ECMAScript Modules are also supported alongside CommonJS, with the appropriate format being selected based on Export Maps. Code destined for Node should be packaged in both formats to provide flexibility and version compatibility.

If you're targeting modern browsers, ECMAScript Modules are best, however older browsers may not support it. Even in newer browsers, support for modules isn't available in some contexts: Web Workers only support modules in Chrome, and no browsers support modules in service workers. In these cases, a custom module format implementation must be used to ensure browser support.

Use the (+) card below & tell us if we missed a capability!

Plant with tall leafs and vines in a pot

Questions or Concerns?

We want to hear from you, let us know how to make this better. Open up a GitHub issue and we’ll track it there. Thanks!

Open a GitHub Issue