TLDR: Does anyone know of a npm package CDN that bundles the Javascript into a non-module js file?
I’m looking to use this package in a userscript. It’s a simple userscript, so I’d rather just use the userscript @require keyword to import it into the single file script.
Generally, you can’t do this for ES Module (and maybe even CommonJS) js files. The normal dist js file for this package has an export{…} clause that makes it incompatible with the @require keyword.
I’ve been looking for JS CDNs that might be able to bundle the js for me into a form that’s usable in vanilla-JS situations like this one. Here are all the CDNs I’ve found:
- https://unpkg.com/: Seems to just provide the npm entry files straight up. Can’t use.
- https://www.jsdelivr.com/: Also just seems to provide the files without transformation. It seems super popular though; am I missing something?
- https://www.skypack.dev/: Again, just provides the files straight up.
- https://bundle.run/: I think this might have bundled things using Rollup. Dead now.
- https://wzrd.in/: Would have worked; bundled things using Browserify. Dead now.
- https://bundle.fregante.com: Properly bundles things, but can’t really act like a CDN.
- https://cdnjs.com: Contains curated pre-bundled files only.
I can probably get away with just bundling the package myself, or (if I feel like tinkering), running my own instances of one of the dead bundling CDNs. But I’m wondering if there is a CDN out there that does what I want, especially since I haven’t found a new major CDN introduced to the ecosystem that’s newer than 2017.