Tutorial: publishing ESM-based npm packages with TypeScript
Briefly

The article highlights recent advancements in ESM support for TypeScript, Node.js, and browsers, detailing the author's modern package setup that prioritizes simplicity and maintains focus on cutting-edge capabilities. With the ease introduced by TypeScript 4.7, users can streamline their configurations in tsconfig.json. The article outlines a structured file system layout, emphasizes the importance of version control with Git, and discusses best practices for project inclusions like README.md and LICENSE files, while explaining the rationale behind excluding certain directories from Git.
During the last two years, ESM support in TypeScript, Node.js and browsers has made a lot of progress.
The setup has worked well for me for a while - since TypeScript 4.7 (2022-05-24).
It's usually a good idea to include a README.md and a LICENSE.
The compilation output of TypeScript is not checked into Git, but it is uploaded to the npm registry.
Read at 2ality
[
|
]