import { denoLoaderPlugin } from "https://deno.land/x/esbuild_deno_loader@0.7.1/src/plugin_deno_loader.ts";
The Deno loader plugin for esbuild. This plugin will load fully qualified
file
, http
, https
, and data
URLs.
Note that this plugin does not do relative->absolute specifier
resolution, or import map resolution. You must use the denoResolverPlugin
before the denoLoaderPlugin
to do that.
This plugin can be backed by two different loaders, the native
loader and
the portable
loader.
Native Loader
The native loader shells out to the Deno executable under the hood to load
files. Requires --allow-read
and --allow-run
. In this mode the download
cache is shared with the Deno executable. This mode respects deno.lock,
DENO_DIR, DENO_AUTH_TOKENS, and all similar loading configuration.
When the plugin is configured to use the native loader, it can auto-discover
deno.lock and all similar configuration files if the cwd
option is set.
Portable Loader
The portable loader does module downloading and caching with only Web APIs.
Requires --allow-read
and/or --allow-net
. This mode does not respect
deno.lock, DENO_DIR, DENO_AUTH_TOKENS, or any other loading configuration. It
does not cache downloaded files. It will re-download files on every build.