Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
docs: improve description
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber authored Sep 14, 2023
1 parent ceae2b3 commit f21fe06
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cjs-loader

Node.js `require()` hook for loading ESM & TypeScript using [esbuild](https://esbuild.github.io/).
Node.js `require()` hook for loading ESM & TypeScript.

### Features
- Transforms ESM & TypeScript to CommonJS on demand
Expand All @@ -10,11 +10,13 @@ Node.js `require()` hook for loading ESM & TypeScript using [esbuild](https://es
- Handles `node:` import prefixes
- Resolves `tsconfig.json` [`paths`](https://www.typescriptlang.org/tsconfig#paths)

> **Tip:**
> **Protip:** use with _esm-loader_ or _tsx_
>
> _cjs-loader_ doesn't hook into dynamic `import()` calls.
> _cjs-loader_ only transforms CommonJS modules (`.cjs`/`.cts` or `.js` files in `commonjs` type packages).
>
> Use this with [esm-loader](https://github.com/esbuild-kit/esm-loader) for `import()` support. Alternatively, use [tsx](https://github.com/esbuild-kit/tsx) to handle them both automatically.
> To hook into `import()` calls or ES modules (`.mjs`/`.mts` extensions or `.js` files in `module` type packages), use this with [esm-loader](https://github.com/esbuild-kit/esm-loader).
>
> Alternatively, use [tsx](https://github.com/esbuild-kit/tsx) to handle them both automatically.
<br>

Expand Down

0 comments on commit f21fe06

Please sign in to comment.