### Install @total-typescript/tsconfig package Source: https://github.com/total-typescript/tsconfig/blob/main/readme.md Instructions to install the `@total-typescript/tsconfig` package as a development dependency using npm. ```bash npm install --save-dev @total-typescript/tsconfig ``` -------------------------------- ### Extend TSConfig for a Bundler DOM App Source: https://github.com/total-typescript/tsconfig/blob/main/readme.md Example of how to extend a `tsconfig.json` file to use the base configuration for an application running in the DOM with an external bundler. This is a common setup for modern frontend frameworks. ```jsonc { // I'm building an app that runs in the DOM with an external bundler "extends": "@total-typescript/tsconfig/bundler/dom/app" } ``` -------------------------------- ### Extend TSConfig for Bundler based projects Source: https://github.com/total-typescript/tsconfig/blob/main/readme.md Provides various `tsconfig.json` `extends` paths for projects that use an external bundler (e.g., Vite, Remix, Astro, Nuxt) instead of `tsc` for transpilation. Configurations are available for apps, libraries, and monorepos, both for DOM and non-DOM (e.g., Node.js) environments. ```jsonc { // My code runs in the DOM: "extends": "@total-typescript/tsconfig/bundler/dom/app", // For an app "extends": "@total-typescript/tsconfig/bundler/dom/library", // For a library "extends": "@total-typescript/tsconfig/bundler/dom/library-monorepo", // For a library in a monorepo // My code _doesn't_ run in the DOM (for instance, in Node.js): "extends": "@total-typescript/tsconfig/bundler/no-dom/app", // For an app "extends": "@total-typescript/tsconfig/bundler/no-dom/library", // For a library "extends": "@total-typescript/tsconfig/bundler/no-dom/library-monorepo" // For a library in a monorepo } ``` -------------------------------- ### Extend TSConfig for tsc based projects Source: https://github.com/total-typescript/tsconfig/blob/main/readme.md Provides various `tsconfig.json` `extends` paths for projects that use the TypeScript compiler (`tsc`) to transpile `.ts` files to `.js`. Configurations are available for apps, libraries, and monorepos, both for DOM and non-DOM (e.g., Node.js) environments. ```jsonc { // My code runs in the DOM: "extends": "@total-typescript/tsconfig/tsc/dom/app", // For an app "extends": "@total-typescript/tsconfig/tsc/dom/library", // For a library "extends": "@total-typescript/tsconfig/tsc/dom/library-monorepo", // For a library in a monorepo // My code _doesn't_ run in the DOM (for instance, in Node.js): "extends": "@total-typescript/tsconfig/tsc/no-dom/app", // For an app "extends": "@total-typescript/tsconfig/tsc/no-dom/library", // For a library "extends": "@total-typescript/tsconfig/tsc/no-dom/library-monorepo" // For a library in a monorepo } ``` -------------------------------- ### Configure JSX in TSConfig Source: https://github.com/total-typescript/tsconfig/blob/main/readme.md How to add the `jsx` compiler option to your `tsconfig.json` when using the `@total-typescript/tsconfig` base configurations, specifically for projects that include JSX syntax. ```json { "extends": "@total-typescript/tsconfig/bundler/dom/app", "compilerOptions": { "jsx": "react-jsx" } } ``` -------------------------------- ### Configure outDir in TSConfig for tsc Source: https://github.com/total-typescript/tsconfig/blob/main/readme.md How to set the `outDir` compiler option in your `tsconfig.json` to specify the output directory for compiled JavaScript files, primarily relevant when using `tsc` for transpilation. ```json { "extends": "@total-typescript/tsconfig/tsc/no-dom/library", "compilerOptions": { "outDir": "dist" } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.