esbuild-plugin-import-glob icon indicating copy to clipboard operation
esbuild-plugin-import-glob copied to clipboard

Import syntax not working

Open jbjanot opened this issue 1 year ago • 1 comments

Hey there! Thanks a lot for this plugin!

I am trying to use it with an import syntax like that :

import ImportGlobPlugin from 'esbuild-plugin-import-glob';
await esbuild.build( {
	entryPoints: [ './main.js' ],
	bundle: true,
	outfile: './scripts.js',
	plugins: [
		ImportGlobPlugin(),
	],
} );

But I get this error: TypeError: ImportGlobPlugin is not a function

Is there anything I can do?

Thank you very much for your help!

jbjanot avatar Mar 27 '24 11:03 jbjanot

This worked in my case:

import ImportGlobPlugin from "esbuild-plugin-import-glob";
const ImportGlob = ImportGlobPlugin.default

await esbuild.build({
  plugins: [ImportGlob()],
  // ...
})

d-mato avatar Apr 12 '24 04:04 d-mato