Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import syntax not working #20

Open
jbjanot opened this issue Mar 27, 2024 · 1 comment
Open

Import syntax not working #20

jbjanot opened this issue Mar 27, 2024 · 1 comment

Comments

@jbjanot
Copy link

jbjanot commented Mar 27, 2024

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!

@d-mato
Copy link

d-mato commented Apr 12, 2024

This worked in my case:

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants