Skip to content

Add ESM build output for bundler resolution - #9

Merged
bensie merged 2 commits into
mainfrom
bensie/fix-esm-named-export
Mar 6, 2026
Merged

Add ESM build output for bundler resolution#9
bensie merged 2 commits into
mainfrom
bensie/fix-esm-named-export

Conversation

@bensie

@bensie bensie commented Mar 6, 2026

Copy link
Copy Markdown
Member

Summary

Adds ESM format output files and declares the module entry point in package.json to support bundlers like Vite, Webpack, and Rollup. This fixes the SyntaxError where bundlers couldn't find the named export 'HotsockClient' when using the package.

Changes

  • Added dist/hotsock.esm.js and dist/hotsock.esm.min.js outputs to rollup config
  • Added "module" field to package.json pointing to the ESM build
  • All 139 tests pass

bensie added 2 commits March 6, 2026 12:22
This adds ESM format output (dist/hotsock.esm.js and dist/hotsock.esm.min.js) to rollup and declares the module entry point in package.json. Bundlers like Vite now correctly resolve the named export 'HotsockClient' instead of falling back to the UMD build.
@bensie
bensie merged commit 91fb451 into main Mar 6, 2026
1 check passed
@bensie
bensie deleted the bensie/fix-esm-named-export branch March 6, 2026 20:23
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