{"id":25312,"library":"esbuild-plugin-autoload","title":"esbuild-plugin-autoload","description":"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.","status":"active","version":"0.3.3","language":"javascript","source_language":"en","source_url":"https://github.com/kravetsone/esbuild-plugin-autoload","tags":["javascript","esbuild-plugin","bun-plugin","autoload","elysia","elysia-plugin","gramio","gramio-plugin","typescript"],"install":[{"cmd":"npm install esbuild-plugin-autoload","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-autoload","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-autoload","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; requires Node >=22 or Bun >=1.1","wrong":"const autoload = require('esbuild-plugin-autoload')","symbol":"autoload","correct":"import { autoload } from 'esbuild-plugin-autoload'"},{"note":"Both named and default imports are supported and equivalent.","wrong":"import { autoload } from 'esbuild-plugin-autoload'","symbol":"autoload as default","correct":"import autoload from 'esbuild-plugin-autoload'"},{"note":"TypeScript type exported for options object.","wrong":null,"symbol":"type AutoloadOptions","correct":"import type { AutoloadOptions } from 'esbuild-plugin-autoload'"}],"quickstart":{"code":"import { autoload } from 'esbuild-plugin-autoload'\nimport esbuild from 'esbuild'\n\nawait esbuild.build({\n  entryPoints: ['src/index.ts'],\n  outdir: 'dist',\n  bundle: true,\n  plugins: [\n    autoload({\n      pattern: '**/*.{ts,tsx,js}',\n      directory: './src/routes',\n      debug: process.env.DEBUG === '1'\n    })\n  ]\n})\n\nconsole.log('Build complete')","lang":"typescript","description":"Minimal esbuild setup with autoload plugin to scan './src/routes' for files and generate import statements at build time."},"warnings":[{"fix":"Upgrade to Bun 1.1+ or Node 22+. Alternatively, use v0.2.x if locked to older runtimes.","message":"Requires Bun >=1.1 or Node >=22 for Glob support; older runtimes will throw.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Bundle with Bun.build first, then compile the output with `bun build --compile out/index.js`.","message":"Bun compile mode does not support runtime autoload without an extra build step; see the Bun issue.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Check your autoload library against the supported list. Open an issue to request new ones.","message":"Only supports elysia-autoload and @gramio/autoload; other autoload libraries will not work.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use `import { autoload }` instead of `import autoload`.","message":"Default import and named import are both allowed; no deprecation yet, but prefer named import for consistency.","severity":"deprecated","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.3.3':21 '1.1':25 '22':28 'autoload':4,9,19,46,68,94 'autoload-cap':45 'base':84 'build':12 'bun':24,92 'bun-plugin':91 'capabl':47 'convent':83 'convention-bas':82 'directori':32 'elysia':18,67,95,97 'elysia-autoload':17,66 'elysia-plugin':96 'elysia.js':75 'esbuild':2,89 'esbuild-plugin':88 'esbuild-plugin-autoload':1 'esbuild/bun':5 'file':34,85 'find':50 'generat':40 'generic':55 'glob':37,56 'gramio':77,99,101 'gramio-plugin':100 'gramio/autoload':15,70 'import':41,63 'javascript':87 'librari':48 'load':86 'make':71 'match':35 'node':27 'one':59 'patch':61 'pattern':10,38 'plugin':3,6,57,90,93,98,102 'project':78 'reli':80 'requir':23 'resolut':64 'resolv':8 'runtim':53 'scan':30 'specif':60 'stabl':22 'statement':42 'support':14 'time':13 'typescript':103 'unlik':54 'use':73 'version':20","created_at":"2026-05-01T13:44:07.340045+00:00","updated_at":"2026-05-01T13:44:07.340045+00:00","problems":[{"fix":"Upgrade Node to >=22 or Bun to >=1.1.","cause":"Runtime version too low; Glob API requires Node >=22 or Bun >=1.1.","error":"Error: The plugin \"esbuild-plugin-autoload\" must be run with at least Node v22 or Bun v1.1"},{"fix":"Use default import: `import autoload from 'esbuild-plugin-autoload'`.","cause":"Default import used incorrectly with named export expectations.","error":"TypeError: autoload is not a function"},{"fix":"Use import syntax: `import { autoload } from 'esbuild-plugin-autoload'`.","cause":"Using CommonJS require() in an ESM project.","error":"ReferenceError: require is not defined in ES module scope"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/kravetsone/esbuild-plugin-autoload","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/esbuild-plugin-autoload","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}