utility submodule for identifying an http response's mime type ("content-type" header), and mapping it to an esbuild loader.
TODO: currently, the mime and extension to esbuild loader mapping is immutable.
the end user might benefit more if they could directly modify it,
instead of only being able to modify it via mimeTypeLoaderMap and extensionTypeLoaderMap.
but on the other hand, making them immutable would mean that we will not be able to use a an InvertibleMap class,
and instead have to always generate the inverse map on every call to guessMimeLoaders, which is highly inefficient.
or alternatively, we might have to store the data in an inverted map in the first place to prevent the need for inverting.
but that will make its representation quite ugly.
utility submodule for identifying an http response's mime type ("content-type" header), and mapping it to an esbuild loader.
TODO: currently, the mime and extension to esbuild loader mapping is immutable. the end user might benefit more if they could directly modify it, instead of only being able to modify it via
mimeTypeLoaderMap
andextensionTypeLoaderMap
. but on the other hand, making them immutable would mean that we will not be able to use a anInvertibleMap
class, and instead have to always generate the inverse map on every call toguessMimeLoaders
, which is highly inefficient. or alternatively, we might have to store the data in an inverted map in the first place to prevent the need for inverting. but that will make its representation quite ugly.