Skip to content

Commit 3a3ce2f

Browse files
committed
Added section on import type and added CJS context to module NodeNext
1 parent 00674f1 commit 3a3ce2f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

book-content/chapters/14-configuring-typescript.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,34 @@ This is because the bundler will take care of resolving the file paths and exten
363363

364364
This means that if you're using an external bundler or transpiler, you should use `module: "Preserve"` in your `tsconfig.json` file. This is also true if you're using a frontend framework like Next.js, Remix, Vite, or SvelteKit - it will handle the bundling for you.
365365

366+
## `import type`
367+
368+
<!-- TODO -->
369+
370+
### `import type { X }` vs `import { type X }`
371+
372+
<!-- TODO -->
373+
374+
### `verbatimModuleSyntax` Enforces `import type`
375+
376+
<!-- TODO -->
377+
378+
## ESM and CommonJS
379+
380+
<!-- TODO -->
381+
382+
### `type` In `package.json` And `module: NodeNext`
383+
384+
<!-- TODO -->
385+
386+
### `verbatimModuleSyntax` With ESM and CommonJS
387+
388+
<!-- TODO -->
389+
390+
#### `import X = require('x')`
391+
392+
<!-- TODO -->
393+
366394
## `noEmit`
367395

368396
The `noEmit` option in `tsconfig.json` tells TypeScript not to emit any JavaScript files when transpiling your TypeScript code.

0 commit comments

Comments
 (0)