Creating a react library, why bundle to ESM?

This page summarizes the projects mentioned and recommended in the original post on /r/reactjs

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • Microbundle

    📦 Zero-configuration bundler for tiny modules.

  • I would recommend starting by using https://github.com/developit/microbundle , as it has pretty good default behavior for generating library output.

  • react-bootstrap

    Bootstrap components built with React

  • Huh. Looking at the build script for react-bootstrap on the bs4-dev branch, they are using Webpack... but it looks like it's just to build the UMD bundles like https://unpkg.com/browse/react-bootstrap@2.0.3/dist/react-bootstrap.js . The CJS/ESM output is generated by just running Babel directly on the source files and outputting them individually.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • react-menu

    React component for building accessible menu, dropdown, submenu, context menu, and more.

  • You could have a look what I'm shipping for my library https://github.com/szhsin/react-menu/tree/master/dist

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts