react-modal icon indicating copy to clipboard operation
react-modal copied to clipboard

Publish an ESM version on npm

Open felixgirault opened this issue 3 years ago • 0 comments

Summary:

I'm having trouble optimizing react-modal with build tools. The published version (in the lib folder) does not provide "true" modules (using export), but a precompiled version. This makes it hard for bundlers like webpack or parcel to optimize.

Steps to reproduce:

It is kind of hard to provide a simple example...

For the record, I'm currently trying to use a babel plugin to remove prop types from the production build, but it can't understand the structure of the code correctly, and thus can't eliminate code.

Aslo, from what I've seen, tree shaking doesn't seem to work as well as it should.

Expected behavior:

The npm package should provide an ESM version of the module. I think this would be the correct answer to this previous issue: https://github.com/reactjs/react-modal/issues/650

Additional notes:

Thank you for your work :)

felixgirault avatar May 04 '22 12:05 felixgirault