fix(build): bundle @noble into the IIFE build for browser/CDN consumers - #200
Conversation
The IIFE (unpkg) build externalized @noble/hashes and @noble/curves, emitting them as undefined globals (_noble_hashes_sha3, _noble_curves_secp256k1), so a <script>/CDN consumer hit 'ReferenceError: _noble_hashes_sha3 is not defined' and window.abstractionkit was never defined. Bundle @noble into the IIFE (platform: browser, so its crypto shim uses Web Crypto rather than node:crypto) while keeping it external for CJS/ESM so npm consumers dedupe a single copy. Drop the dead ethers external config (ethers is not a runtime import). Verified in headless Chrome: window.abstractionkit defined, keccak and secp256k1 paths work.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe build configuration file is refactored to support multiple output targets with shared settings. A base ChangesBuild configuration multi-target refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Follow-up to #200. The IIFE (unpkg) build targets <script>/CDN consumers, but that path is undocumented and unused -- abstractionkit consumers install via npm and use a bundler (ESM/CJS), both unaffected. Rather than maintain a second-class distribution (and ship a ~600 kB self-contained artifact) for a near-empty audience, remove the iife format and the unpkg field. CJS, ESM and type outputs are unchanged.
The IIFE (
unpkg) build externalized@noble/hashesand@noble/curves, emitting them as undefined globals (_noble_hashes_sha3,_noble_curves_secp256k1). Loading the script via a CDN/<script>tag threwReferenceError: _noble_hashes_sha3 is not definedandwindow.abstractionkitwas never defined. Bundles@noble/*into the IIFE (withplatform: browserso its crypto shim uses Web Crypto, notnode:crypto) while keeping it external for CJS/ESM. Also drops the deadethersexternal config. Verified in headless Chrome.Summary by CodeRabbit