From c7d89986471f27723289ef6f2404a7d70c7774f5 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Tue, 30 May 2023 17:20:32 +0200 Subject: [PATCH] Update README.md --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d4ae6e0..53bd4b2 100644 --- a/README.md +++ b/README.md @@ -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