Update README.md

This commit is contained in:
Joseph Garrone 2023-05-28 14:15:54 +02:00 committed by GitHub
parent fa27fe245b
commit c04d0ba667
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,6 +58,15 @@ that being said, this feature is optional and can be [disabled](https://github.c
# Release in CJS, ESM or both
Contrary to what other guides or project starters may suggest, you don't necessarily need Vite/rollup to bundle your library,
nor do you need to fragment your modules into smaller, independently published units on NPM under the package/ directory for your module
to be tree-shakable (e.g., `@your-module/submodule1`, `@your-module/submodule2`).
The reality is much simpler. The responsibility of bundling lies with the final application; your role involves merely
publishing `.js` files and types declaration `.d.ts` files, which are the output of `tsc`.
And that's all there is to it!
## CJS only (default)
By default your module release [in CommonJS (CJS)](https://github.com/garronej/ts-ci/blob/8390339b52c98cdbd458d4b945286f999358a1ff/tsconfig.json#L3) with [ESM module interop](https://github.com/garronej/ts-ci/blob/8390339b52c98cdbd458d4b945286f999358a1ff/tsconfig.json#L6).