muxinc / upchunk

Uploads Chunks! Takes big files, splits them up, then uploads each one with care (and PUT requests).
MIT License
340 stars 46 forks source link

build: replace esbuild iife dist with umd, using plugin developed for… #120

Closed cjpillsbury closed 10 months ago

cjpillsbury commented 10 months ago

… this case.

Currently, esbuild does not support and may never natively support a umd target (See: https://github.com/evanw/esbuild/issues/507). However, many build tools or default configurations for web app framework scaffolding tools still unfortunately make a variety of assumptions that result in iife targets insufficient as a "fallback" case (our current strategy). Luckily, since the primary difference between esbuilds iife and a umd build is header/footer content in the resultant .js file (with some *'s around e.g. bundled vs. unbundled that are irrelevant to our usage), someone has built a plugin for this 🎉 (See: https://github.com/Inqnuam/esbuild-plugin-umd-wrapper).

This PR replaces our iife build (and its corresponding identifications in package.json) with a umd flavor instead. Furthermore, I've confirmed that this resolves the default parcel usage locally via a local link.

This will hopefully also resolve the various other build scenarios called out in #88