Registry /
devops / esbuild-plugin-import-glob
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
✓ import ImportGlobPlugin from 'esbuild-plugin-import-glob';
✗ const ImportGlobPlugin = require('esbuild-plugin-import-glob');
Default export is a function that creates the plugin instance.
glob import (default)
✓ import migrationsArray from './migrations/**/*';
✗ const migrationsArray = require('./migrations/**/*');
When using default import, each module's default export is collected into an array.
glob import (namespace)
✓ import * as migrations from './migrations/**/*';
✗ import migrations from './migrations/**/*';
Namespace import yields an object with 'default' (array of modules) and 'filenames' (array of paths).
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
Errors
Common errors & fixes
Error: The plugin 'esbuild-plugin-import-glob' is not compatible with esbuild version X.X.X
Plugin may depend on esbuild internals that change between versions.
fixCheck plugin's peerDependencies and use a compatible esbuild version.
TypeError: Cannot read properties of undefined (reading 'default')
Accessing default export from import * as X when module has no default export.
fixEnsure each matched file has a default export, or use namespace import and access properties directly.
Audit
Dependencies
No dependency data recorded yet.