Closed Niputi closed 2 years ago
Hey, I tried it and it on webpack project as well and it seemed to correctly pick prod/dev bundle and so on. Good job, I wasn't aware that conditional export was possible with ESM.
Does it matter that type definitions aren't in package.json? The types are working fine in my environment.
closes: https://github.com/markusenglund/react-switch/issues/100
simplified build process a little with type hints
upgraded enzyme as it was giving me error message react not being version 16
upgraded webpack as I wasn't able to install packages on node version 17.4.0 without upgrades
added esm/cjs to package exports with conditional development/production
have tested this change in a vite project under dev and production and it seems to be working.
fyi: your typescript definitions are not currently defined in the package json I didn't add it in this commit as I'm not sure how it should be handled for users since it depends on react types