Skip to content

Add ESM support and re-export CJS entry point in js-host-api#101

Merged
simongdavies merged 1 commit intomainfrom
fix-cjs-epm
Apr 9, 2026
Merged

Add ESM support and re-export CJS entry point in js-host-api#101
simongdavies merged 1 commit intomainfrom
fix-cjs-epm

Conversation

@simongdavies
Copy link
Copy Markdown
Contributor

This pull request adds support for ES module (ESM) imports to the js-host-api package, making it compatible with both ESM and CommonJS consumers. The main changes include the addition of a new ESM entry point and updates to the package export configuration.

ESM support and package exports:

  • Added a new ESM entry point lib.mjs that re-exports all main API symbols from the CommonJS entry point, allowing usage with import syntax in ESM environments.
  • Updated package.json to include a module field and a new exports map, ensuring correct entry points and type definitions are used for both ESM (import) and CommonJS (require) consumers.

Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
@simongdavies simongdavies added the kind/bugfix Bug fix label Apr 9, 2026
@simongdavies simongdavies merged commit 6779509 into main Apr 9, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants