JSPM

esbuild-plugin-deno-remote-import

0.2.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q31970F
  • License GPL3

esbuild plugin to fetch remote imports for Deno

Package Exports

  • esbuild-plugin-deno-remote-import
  • esbuild-plugin-deno-remote-import/mod.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (esbuild-plugin-deno-remote-import) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

esbuild-plugin-deno-remote-import

main-workflow

This is an esbuild plugin to fetch remote imports for Deno. It was designed for cases when Deno is used for development but the application will run in a browser. It comes with the same caching approach that Deno uses when fetching from remote URLs, proper handling of stale caches and HTTP redirects.

Take care of setting up the value of DENO_DIR as it is recommended to ensure consistency between the plugin's and Deno's cache locations, if you're interested.

Usage

import { esbuild } from "https://deno.land/x/esbuild@v0.17.11/mod.js";
import { denoRemoteImport } from "https://deno.land/x/esbuild_plugin_deno_remote_import";

await esbuild.build({
    plugins: [denoRemoteImport()],
    bundle: true,
    // etc...
});

esbuild.stop();

See the example file and tests for more details.

Permissions

The following permissions are required:

  • --allow-read in order to read caches.
  • --allow-write in order to write caches.
  • --allow-env in order to determine the location of Deno or user home.
  • --allow-net to fetch from remote addresses.

License

esbuild-plugin-deno-remote-import is licensed under the GPL3 License, see LICENSE for more information.