Skip to content

feat: publish esm-only package - #155

Open
anajavi wants to merge 5 commits into
Faire:mainfrom
anajavi:feat/esm-only
Open

feat: publish esm-only package#155
anajavi wants to merge 5 commits into
Faire:mainfrom
anajavi:feat/esm-only

Conversation

@anajavi

@anajavi anajavi commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

closes #72

  • add type: "module" to package.json
  • build only esm, commonjs was dropped

notes:

  1. converted tests to vitest as jest+ts-jest was way too hard to make work with moduleResolution: nodenext
  2. I had to bypass commit hooks as prettier@2 is too old to understand import attributes:
    import entities from "./html-entities.json" with { type: "json" };
    Separate PR for prettier upgrade chore: upgrade prettier to v3 #156
  3. I added a couple of eslint rules to prevent type only imports pulling code along.
  4. Removed ts-node as node can run ts files by itself

require(esm) from commonjs supported in node since:

I can add exports map to package.json if it is needed.

@anajavi

anajavi commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

As this is already a breaking change, might as well change the jsx transform on tsconfig to:

"jsx": "react-jsx"

"jsx": "react",

React 19 wants to use it:
https://react.dev/blog/2024/04/25/react-19-upgrade-guide#new-jsx-transform-is-now-required

The jsx transform is supported since react 16.14

Doing it now might prevent a breaking change in the future.

What do you think?

@anajavi

anajavi commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@emmclaughlin do you think releasing ESM only package is the right way?

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.

publish package so both esm and cjs can co-exist with the same imports

1 participant