esbuild/Bun plugin that resolves autoload patterns at build time, supporting @gramio/autoload and elysia-autoload. Version 0.3.3 (stable), requires Bun >=1.1 or Node >=22. It scans a directory for files matching a glob pattern and generates import statements so that autoload-capable libraries can find them at runtime. Unlike generic glob plugins, this one specifically patches the import resolution for elysia-autoload and @gramio/autoload, making it useful for Elysia.js and Gramio projects that rely on convention-based file loading.
npm install esbuild-plugin-autoloadNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minimal esbuild setup with autoload plugin to scan './src/routes' for files and generate import statements at build time.
Upgrade to Bun 1.1+ or Node 22+. Alternatively, use v0.2.x if locked to older runtimes.
Bundle with Bun.build first, then compile the output with `bun build --compile out/index.js`.
Check your autoload library against the supported list. Open an issue to request new ones.
Use `import { autoload }` instead of `import autoload`.Upgrade Node to >=22 or Bun to >=1.1.
Use default import: `import autoload from 'esbuild-plugin-autoload'`.
Use import syntax: `import { autoload } from 'esbuild-plugin-autoload'`.No dependency data recorded yet.