mirror of
https://github.com/garronej/ts-ci.git
synced 2025-11-30 21:43:05 +00:00
Update README.md
This commit is contained in:
parent
06e2e5591a
commit
c7d8998647
1 changed files with 2 additions and 5 deletions
|
|
@ -119,13 +119,12 @@ Regardless of the scenario you opt for you can always release for Deno using [De
|
|||
|
||||
Pursuing a fully compliant CJS + ESM distribution comes with caveats. It only works well if all your dependencies are adherent to the standard, a condition that [most modules fail to meet](https://github.com/mui/material-ui/issues/37335).
|
||||
|
||||
This method introduces the risk of your package being simultaneously loaded in both CJS and ESM in a single application. It also poses a similar risk to your dependencies.
|
||||
This method introduces the risk of your package being simultaneously loaded in both CJS and ESM in a single node application. It also poses a similar risk to your dependencies.
|
||||
|
||||
Thus, proceed with this option only if it's necessary for your lazy imports to actually be lazy when your code runs on Node.js.
|
||||
Thus, proceed with this option only if it's necessary for your lazy imports to actually be lazy when your code runs on Node.
|
||||
|
||||
- To transpile in ESM, use [`js2mjs`](https://github.com/garronej/js2mjs) to ensure your ESM distribution generated by TypeScript is fully compliant with the standard ([An external script should not be required for this!](https://github.com/microsoft/TypeScript/issues/18442)). [See Example](https://github.com/garronej/tsafe/blob/6d08839c3b0695edbc3443d21b256043cd98787b/package.json#L10-L12)
|
||||
- Declare your exports using both `require` and `import`. [See Example](https://github.com/garronej/tsafe/blob/6d08839c3b0695edbc3443d21b256043cd98787b/package.json#L64-L78).
|
||||
|
||||
Checkout the full example with [tsafe](https://github.com/garronej/tsafe/tree/6d08839c3b0695edbc3443d21b256043cd98787b) (use the specifically this link, the current version doesn't release an
|
||||
ESM distribution anymore, it doesn't need to).
|
||||
|
||||
|
|
@ -140,8 +139,6 @@ If you find your self thinking:
|
|||
|
||||
Just [start a discussion](https://github.com/garronej/ts-ci/discussions) or hit [my Twitter DM](https://twitter.com/GarroneJoseph) I'll be happy to provide further guidance.
|
||||
|
||||
|
||||
|
||||
# FAQ
|
||||
|
||||
<details>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue