v1.1.0
An esbuild plugin to generate bookmarklets!
Attributes
Includes Deno configuration
Repository
Current version released
2 weeks ago
Versions
esbuild-plugin-bookmarklet
An ESM-only, Deno-first (supports node) plugin to generate bookmarklet code with esbuild!
Versioning
All releases after v1.0.0 are covered under semver
How to use
Deno
Add to the top of your build script:
import bookmarkletPlugin from "https://deno.land/x/esbuild_plugin_bookmarklet@{VERSION}/mod.js"Replacing {VERSION} with the current released version
Node
Run
npm i esbuild-plugin-bookmarkletAdd to the top of your build script:
import bookmarkletPlugin from "esbuild-plugin-bookmarklet"
Then set the following parameters in your esbuild build script:
minify: true,
write: false,
format: 'iife',
plugins: [bookmarkletPlugin]Example esbuild build 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}/mod.js"
esbuild.build({
entryPoints: ['index.js'], // points to normal javascript
bundle: true,
minify: true,
outfile: 'bookmarklet.js', // where to save bookmarklet javascript
write: false,
format: 'iife',
plugins: [bookmarkletPlugin],
target: ["chrome58", "firefox57", "safari11", "edge16"]
})Node
import * as esbuild from "esbuild";
import bookmarkletPlugin from "esbuild-plugin-bookmarklet"
esbuild.build({
entryPoints: ['index.js'], // points to normal javascript
bundle: true,
minify: true,
outfile: 'bookmarklet.js', // where to save bookmarklet javascript
write: false,
format: 'iife',
plugins: [bookmarkletPlugin],
target: ["chrome58", "firefox57", "safari11", "edge16"]
})