I recommend that libraries publish both a minified UMD bundle and a minified ES module bundle. The UMD bundle provides compatibility with require and CommonJS for legacy environments while the ES module works with modern environments. And I highly recommend Rollup for bundling ES module sources.
The UMD bundle is typically listed as the
main entry in the package.json. To target browsers separately from Node, you could consider using the
unpkg endpoint. (There’s no apparent agreement on a browser-targeting/AMD-compatible entry field in package.json; the obvious choice of
browser is used by Browserify and means something else.)
The ES bundle is listed as the
It’d be nice if three-orbit-controls were updated to include UMD and ES bundles.