
Security News
RubyGems Adds Cooldown Feature to Bundler for Newly Published Gems
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.
esbuild-plugin-autoload
Advanced tools
This esbuild/Bun bundler plugin helps to use libraries for autoload endpoints, command and etc. At the build stage, it obtains what needs to be import-ed and includes it in the final file
[!IMPORTANT] You need
BunorNode@>=22to run this plugin
// @filename: build.ts
import { autoload } from "esbuild-plugin-autoload"; // default import also supported
await Bun.build({
entrypoints: ["src/index.ts"],
target: "bun",
outdir: "out",
plugins: [autoload()],
}).then(console.log);
Then, build it with bun build.ts and run with bun out/index.ts
You can bundle and then compile it into a single executable binary file
import { autoload } from "esbuild-plugin-autoload"; // default import also supported
await Bun.build({
entrypoints: ["src/index.ts"],
target: "bun",
outdir: "out",
plugins: [autoload()],
}).then(console.log);
await Bun.$`bun build --compile out/index.js`;
[!WARNING] You cannot use it in
bun build --compilemode without extra step (Feature issue)
| Key | Type | Default | Description |
|---|---|---|---|
| pattern? | string | "**/*.{ts,tsx,js,jsx,mjs,cjs}" | Glob patterns |
| directory? | string | "./src/routes" | The folder where something that will be autoloaded are located |
| debug? | boolean | false | Debug mode, will log generated code |
You can also pass the directory by the first argument instead of an object with full options
await Bun.build({
entrypoints: ["src/index.ts"],
target: "bun",
outdir: "out",
plugins: [autoload("./src/commands")],
}).then(console.log);
// @filename: build.ts
import { autoload } from "esbuild-plugin-autoload"; // default import also supported
import esbuild from "esbuild";
await esbuild
.build({
entrypoints: ["src/index.ts"],
outdir: "out",
bundle: true,
plugins: [autoload()],
})
.then(console.log);
Then, build it with bunx tsx build.ts and run with node out/index.ts
autoload-ersSadly, this plugin can only work with supported libraries.
unpluginFAQs
Bun/esbuild plugin for work with autoload at runtime
The npm package esbuild-plugin-autoload receives a total of 166 weekly downloads. As such, esbuild-plugin-autoload popularity was classified as not popular.
We found that esbuild-plugin-autoload demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.