cubing / cubing.js

🛠 A library for displaying and working with twisty puzzles. Also currently home to the code for Twizzle.
https://js.cubing.net/cubing/
GNU General Public License v3.0
232 stars 42 forks source link

Figure out how to publish `dist/bin` without bloat. #292

Closed lgarron closed 9 months ago

lgarron commented 9 months ago

build/bin is 1.4MB on its own right now (none shared with dist/lib).

Build together with the lib could result in some chunks in the lib folder that contain bin-only code, and it also conflates some incompatible options: we want to allow top-level await for bin, but we can't yet publish it in the lib without compatibility issues.

Perhaps we could build better and use a separate build or a test to enforce compatibility.

The "right" way to do this would be to let the bin files import cubing/* packages so this both works in bun without build and maps to the build packages when built. Maybe using tsconfig.json?