esbuild-plugin-import-glob
v0.1.1
Published
A esbuild plugin which allows to import multiple files using the glob syntax.
Downloads
134,067
Maintainers
Readme
esbuild-plugin-import-glob
A esbuild plugin which allows to import multiple files using the glob syntax.
Basic Usage
Install this plugin in your project:
npm install --save-dev esbuild-plugin-import-glob
Add this plugin to your esbuild build script:
+const ImportGlobPlugin = require('esbuild-plugin-import-glob'); ... esbuild.build({ ... plugins: [ + ImportGlobPlugin(), ], })
Use import or require
// @ts-ignore import migrationsArray from './migrations/**/*'; // contains default export migrationsArray[0].default;
// @ts-ignore import * as migrations from './migrations/**/*'; const { default: migrationsArray, filenames } = migrations;
const { default: migrationsArray, filenames } = require('./migrations/**/*');