esbuild-plugin-http-fetch
esbuild-plugin-http-fetch copied to clipboard
determine loader from content-type
I wasn't able to use this easily with https://esm.sh/ as the URLs there do not use file extensions.
e.g., import React from 'https://esm.sh/[email protected]'
The extension can be specified by being more verbose, but the type definitions header is removed which is not ideal if using TypeScript.
e.g., https://esm.sh/[email protected]/react.js
Other content-type to loader mappings could be added as users need them. I'd assume the ones I've added are more than enough for most.
A two-pronged approach could maybe be utilized to check both the content type and URL extension. I could add this if preferred.