Open spencercap opened 2 years ago
at least, make esbuild output iife js + set the browser export to use this
building to iife, mjs, cjs: // https://medium.com/geekculture/build-a-library-with-esbuild-23235712f3c
do we wan to use tsup? it's sightly simpler and uses esbuild under the hood. let's chat pros v cons
@youraerials should we decide on an ncc standard. tsup or esbuild for .ts projects.
TSUP!
By default tsup bundles all import-ed modules but dependencies and peerDependencies in your packages.json are always excluded
https://tsup.egoist.dev/#excluding-packages
@enceladus @youraerials it would seem that the default in tsup is to NOT bundle dependencies of the pkg. i guess it assumes the pkg will be used in a project that builds it. i understand this. and instead of bundling algjs to include things like algosdk and buffer in their entirety (as we do now), should we follow suit? considering about the dux experience where the entire bundled pkg IS needed in the browser, we use jsdelivr anyway which handles that. thoughts?
added a tsup configuration on this branch: https://github.com/thencc/algonautjs/tree/tsup-as-bundler
perhaps this needs a new issue, but we need env / import / usage tests for algjs.
there are parts for this in tests/
w the taskfile but it would help make sure this build change works as intended.
envs to cover:
tsup builds on top of esbuild (so it's SUPER fast) + emits type dec files + iife format