Registry / devops / esbuild-plugin-import-glob

esbuild-plugin-import-glob

JSON →
library0.1.1jsnpmunverified

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.

devops
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
musl
node 18223 runs
build_error
glibc
node 18223 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
Debug
Known footguns
gotchaTypeScript will complain about glob import paths with @ts-ignore.
gotchaPlugin version 0.1.1 is very early; API may break without major version bump.
breakingGlob patterns are resolved at build time; dynamic imports with variables are not supported.
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.

Agent activity
13 hits · last 30 days
gptbot
4
ahrefsbot
3
claudebot
3
script
1
meta-externalagent
1
Resources