the regex filters which the plugin's resolvers should use for the interception of resource-paths.
specify the namespace that the http plugin's loader should use for fetchable resources.
if the convertFileUriToLocalPath option is enabled (default),
then file-uris will not use this namespace, and instead adopt the regular ""
namespace.
it is best if you don't modify it to something besides the default value PLUGIN_NAMESPACE.LOADER_HTTP, as this plugin relies on the entry-plugin's prior intervention to have relative-paths and import-map paths resolved to a full http path.
the default loader that the plugin's loader should use for unidentified content types.
if you would like to use esbuild's own default loader, set the value to "default"
.
Optional
acceptonly accept the following subset of loaders when auto content-detection is used for guessing the loader type.
if there is no intersection between the set of guessed loaders, and this set of acceptLoaders
,
then the default loader (defaultLoader) will be used as a fallback.
specify which namespace
s should be intercepted by the http-plugin.
all other namespace
s will not be processed by this plugin.
if you have a plugin with a custom loader that works under some "custom-namespace"
,
you can include your "custom-namespace"
here, so that if it performs an http-import,
that import path will be captured by this plugin, and then consequently fetched by this plugin's http-loader.
but do note that the namespace of the loaded resource will switch to this plugin's loader namespace
(which defaults to PLUGIN_NAMESPACE.LOADER_HTTP), instead of your "custom-namespace"
.
[undefined, "", "file"]
(also this plugin's namespace gets added later on)
specify if "file://"
uris should be converted to local paths,
so that esbuild natively loads them, instead of us fetching the resource ourselves.
when this option is enabled, the resulting resolved local-path of a file uris will not use the namespace config option,
and instead adopt the the default namespace ""
, so that esbuild (or some other plugin) would be capable of loading it.
for best compatibility with ./node_modules/
resolution and other plugins, it is best to have this option enabled always.
that's because if a file uri ends up becoming the resolveDir
of an npm-package resource,
then esbuild will halt and complain that it does not understand the "non-absolute" local path specified,
because it is incapable of interpreting file uris, and will refuse to scan directories based on it.
pluginData
.
on the otherhand, our url-loader will not do such a thingenable or disable file-uri to local path conversion.
enable or disable re-resolution of the local path, to allow other plugins to intercept.
configuration options for the httpPluginSetup and httpPlugin functions.