Skip to content

Conversation

dynst
Copy link
Contributor

@dynst dynst commented Oct 8, 2025

Lays the necessary groundwork for #1804

dist/ is the default output directory. https://tsdown.dev/options/output-directory

(Possibly blocked on #1816 to drop a use of node:crypto paulmillr/noble-hashes@c7ad207) Or not. Found a workaround.

yarn pack-web was failing in the stargate package because:

  • @cosmjs/crypto was being bundled into the build/ 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 webpack runs, where it will resolve to the not-node code (crypto.js).
  • So an explicit --external=@cosmjs/crypto was needed.

dynst added 5 commits October 8, 2025 20:28
dist/ is the universal convention for actually distributing
the library. build/ for temporary build artifacts for tests.
it's still a peer dependency of an eslint plugin in the root, though.
Inexplicably, it isn't auto-detecting like it should.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant