
An ESM-finest, Deno-first (supports node) plugin to generate bookmarklet code with esbuild!
Versioning
All releases after v1.0.0 are lined below semver
The model to make employ of
Deno
Add to the tip of your receive script:
import bookmarkletPlugin from “https://deno.land/x/esbuild_plugin_bookmarklet@{VERSION}/mod.js”
Replacing {VERSION} with essentially the latest launched version
Node
Speed npm i esbuild-plugin-bookmarklet
Add to the tip of your receive script:
import bookmarkletPlugin from “esbuild-plugin-bookmarklet”
Then put the next parameters to your esbuild receive script:
minify: honest appropriate,
write: incorrect,
format: ‘iife’,
plugins: [bookmarkletPlugin]
Example esbuild receive scripts
Deno
import as esbuild from “https://deno.land/x/esbuild@v0.17.11/mod.js”;
import bookmarkletPlugin from “https://deno.land/x/esbuild_plugin_bookmarklet@{VERSION}/predominant.js”
esbuild.receive({
entryPoints: [‘index.js’], // functions to traditional javascript
bundle: honest appropriate,
minify: honest appropriate,
outfile: ‘bookmarklet.js’, // the attach to place bookmarklet javascript
write: incorrect,
format: ‘iife’,
plugins: [bookmarkletPlugin],
goal: [“chrome58”, “firefox57”, “safari11”, “edge16”]
})
Node
import as esbuild from “esbuild”;
import bookmarkletPlugin from “esbuild-plugin-bookmarklet”
esbuild.receive({
entryPoints: [‘index.js’], // functions to traditional javascript
bundle: honest appropriate,
minify: honest appropriate,
outfile: ‘bookmarklet.js’, // the attach to place bookmarklet javascript
write: incorrect,
format: ‘iife’,
plugins: [bookmarkletPlugin],
goal: [“chrome58”, “firefox57”, “safari11”, “edge16”]
})