esbuild-plugin-http-fetch icon indicating copy to clipboard operation
esbuild-plugin-http-fetch copied to clipboard

determine loader from content-type

Open han-tyumi opened this issue 4 years ago • 0 comments

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.

han-tyumi avatar Sep 05 '21 01:09 han-tyumi