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

Create ESM bundle for ESM related projects (Astro, Svelte, Vite, and newer version of Next.js) #801

Open
xiaolin opened this issue Aug 22, 2024 · 1 comment

Comments

@xiaolin
Copy link
Owner

xiaolin commented Aug 22, 2024

Describe the bug
The current webpack bundle only builds UMD which is causing issues with projects in ESM environment.

Image Gallery Version
What version of react-image-gallery are you using?

To Reproduce
Steps to reproduce the behavior:

  1. Create a project using Astro
  2. Import this library
  3. It breaks

Expected behavior
It should work with ESM projects

@xiaolin
Copy link
Owner Author

xiaolin commented Aug 22, 2024

Current workaround for ESM projects is to do the below.

import Gallery from 'react-image-gallery';
const ImageGallery = Gallery.default ? Gallery.default : Gallery;

@xiaolin xiaolin changed the title Create ESM package for ESM related projects (Astro, Svelte, Vite, and newer version of Next.js) Create ESM bundle for ESM related projects (Astro, Svelte, Vite, and newer version of Next.js) Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant