An esbuild plugin (v1.0.0) that enables importing multiple modules using a glob pattern, returning an object mapping file paths to their module exports (including named exports). The result is inspired by Vite's glob import but is not identical. It's stable but not actively maintained (latest release 2020). Unlike alternatives (e.g., esbuild-plugin-import-glob which returns an array and discards named exports), this plugin preserves both default and named exports.
npm install glob-import-esbuild-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure esbuild with the glob import plugin to bundle code that uses glob imports.
Either process paths to be relative if needed, or be aware of absolute paths in your code.
Ensure glob patterns are relative to the importing file's location.
Use literal strings for glob patterns, not variables or expressions.
Use ESM import: import globImportPlugin from 'glob-import-esbuild-plugin'.
Pass globImportPlugin() (with parentheses) in the plugins array.
Double-check the glob pattern path relative to the file using it.
No dependency data recorded yet.