Registry /
devops / esbuild-plugin-import-glob
A esbuild plugin that enables glob pattern imports, allowing developers to import multiple files using syntax like './migrations/**/*'. Current stable version is 0.1.1. It has no active development cadence (last release likely 2021). Key differentiator: simple integration with esbuild, supports ESM and CJS import styles, returns an array of module exports along with filenames. Lightweight and zero-config.
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–223 runs
build_error
glibcnode 18–223 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Default export is a function that creates the plugin instance.
import ImportGlobPlugin from 'esbuild-plugin-import-glob';
When using default import, each module's default export is collected into an array.
import migrationsArray from './migrations/**/*';
Namespace import yields an object with 'default' (array of modules) and 'filenames' (array of paths).
import * as migrations from './migrations/**/*';
Shows how to set up the plugin in an esbuild build script and use glob imports in source files.
// esbuild script
const esbuild = require('esbuild');
const ImportGlobPlugin = require('esbuild-plugin-import-glob');
esbuild.build({
entryPoints: ['src/index.ts'],
bundle: true,
outfile: 'out.js',
plugins: [
ImportGlobPlugin(),
],
}).catch(() => process.exit(1));
// usage in source file (e.g., src/index.ts)
// @ts-ignore
import migrationsArray from './migrations/**/*';
console.log(migrationsArray); // array of module default exports
// @ts-ignore
import * as migrations from './migrations/**/*';
console.log(migrations.default); // same as above
console.log(migrations.filenames); // file paths
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.