seatsio / seatsio-react

The official Seats.io React wrapper
https://www.seats.io
MIT License
22 stars 15 forks source link

fix: Fix the build script and some other cleanup #212

Closed csandman closed 3 months ago

csandman commented 3 months ago

This PR fixes the build script I initially implemented in this package a few months ago! It wasn't technically broken, but I realized I had it set up to make the bundle size much larger than it should be, after realizing I had done the same for one of my own projects.

In the tsup.config.ts file, the entry string was set to the entire src/main directory. The result of this is that it treats every file in the main directory as an entry file for the build, even though it already bundles everything together in the resulting index.js file. So the result is just that there are a bunch of files that are never actually used haha. In most cases, these will just be ignored during the build step of a react app, so it's not really a problem, but it does give the size on NPM some false bloat.

So this change just changes the entry to be src/main/index.ts, and now the only files in the output are the root files that will be imported by the app that imports this package.

And besides that, I just made two other small cleanups that I'll leave individual comments about haha. No big if you want me to remove those.

mortendevold commented 3 months ago

Thanks, good cleanup of the build output and nice to get those other little issues fixed. I'll merge and deploy a new version.