cosmjs
cosmjs copied to clipboard
transpile with tsdown instead of tsc
Lays the necessary groundwork for #1804
dist/ is the default output directory. https://tsdown.dev/options/output-directory
debugging
(Possibly blocked on #1816 to drop a use of `node:crypto` https://github.com/paulmillr/noble-hashes/commit/c7ad2078c1bfb302034d49390c8dd4e2a2a3417b) Or not. Found a workaround.yarn pack-web was failing in the stargate package because:
-
@cosmjs/cryptowas being bundled into thebuild/directory, along with all its dependencies recursively; - This was because it exists in
"devDependencies"and not in"dependencies"; - This would be harmless (webpack is about to bundle all code+dependencies into 1 file anyway), but one of the recursive dependencies,
@noble/hashes, has a particular file that varies in its resolution depending on the environment being node or not-node; - This was being resolved at bundling-time, copying node-specific code (
cryptoNode.js) into build/; - Resolution should instead be deferred to when
webpackruns, where it will resolve to the not-node code (crypto.js). - So an explicit
--external=@cosmjs/cryptowas needed.