@gjsify/esbuild-plugin-deno-loader
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

@gjsify/esbuild-plugin-deno-loader

Deno module resolution for esbuild for Node.js.

This fork makes the plugin executable in Node.js, while the original plugin is used in Deno.

Example

This example bundles an entrypoint into a single ESM output.

import * as esbuild from "esbuild";
import { denoPlugin } from "@gjsify/esbuild-plugin-deno-loader";

await esbuild.build({
    plugins: [denoPlugin()],
    entryPoints: ["https://deno.land/std@0.150.0/hash/sha1.ts"],
    outfile: "./examples/dist/sha1.esm.js",
    bundle: true,
    format: "esm",
});

The output sha1.esm.js will look like this:

// https://deno.land/std@0.150.0/hash/sha1.ts
var HEX_CHARS = "0123456789abcdef".split("");
var EXTRA = [-2147483648, 8388608, 32768, 128];
var SHIFT = [24, 16, 8, 0];
var blocks = [];
var Sha1 = class {
  #blocks;
  #block;
  #start;
  #bytes;
  #hBytes;
  #finalized;
...

Readme

Keywords

Package Sidebar

Install

npm i @gjsify/esbuild-plugin-deno-loader

Weekly Downloads

2

Version

0.0.4

License

none

Unpacked Size

75.8 kB

Total Files

30

Last publish

Collaborators

  • ewlsh
  • schanz
  • jumplink