unsplash / sum-types-io-ts

io-ts bindings for @unsplash/sum-types.
https://unsplash.github.io/sum-types-io-ts/
MIT License
2 stars 1 forks source link

Add ESM support #6

Closed samhh closed 2 years ago

samhh commented 2 years ago

This PR adds ESM support alongside the preexisting CJS.

Conditional exports, the source of some consumer-side configuration complexity in fp-ts-std, are unneeded as we're only publishing a single index module.

Publishing is now a bit less weird, this does away with publishing in dist/. The addition of the prepublish script means publishing is now as simple as yarn/npm publish without a path or prior command.

My local test repo with Webpack saw the bundle size drop from a total of (not gzipped) 74K to 13K.

Once this is merged I'll publish 0.2.1, update web, and assuming all goes well there replicate the same change to the other sum-types repos.