TypeScript Configuration and Performance (original) (raw)
What is the purpose of the tsconfig.json file in a TypeScript project?
- It defines runtime behaviour for TypeScript code.
- It specifies compiler options, file inclusions, and TypeScript project configurations.
- It replaces all JavaScript configuration files.
- It is only required for TypeScript projects larger than 10 files.
Which tsconfig.json option improves performance by only compiling changed files in large projects?
What does the "exclude" option in tsconfig.json do?
- Excludes specific TypeScript files from compilation.
- Prevents JavaScript files from being executed
- Marks files as optional in the TypeScript project.
- Reduces the number of dependencies in node_modules
Which tsconfig.json option can be used to speed up TypeScript compilation by limiting the number of CPU cores used?
- TypeScript does not have a direct CPU-limiting option.
Which tool can be used to analyze and improve TypeScript build performance?
What does the "skipLibCheck": true option do in tsconfig.json?
- Skips type checking for third-party libraries, improving compilation speed.
- Removes all type definitions from node_modules.
- Disables TypeScript’s type-checking system entirely.
- Forces TypeScript to check every single .d.ts file strictly.
How does "isolatedModules": true improve performance in TypeScript projects?
- It ensures each file is compiled independently, allowing faster transpilation.
- It merges all TypeScript files into a single output file.
- It prevents TypeScript from using module imports.
- It optimizes runtime performance instead of compilation speed.
What is the benefit of using esbuild with TypeScript?
- It reduces runtime memory usage in TypeScript applications.
- It speeds up TypeScript transpilation significantly compared to tsc.
- It removes TypeScript's need for tsconfig.json.
- It enables TypeScript code to run in older browsers.
Which strategy helps improve TypeScript build times in a monorepo setup?
- Using project references ("composite": true).
- Running tsc separately for each module.
- Converting all TypeScript files to JavaScript.
What is the advantage of "noEmit": true in TypeScript projects?
- Prevents JavaScript output, useful for type-checking only.
- Optimizes compiled JavaScript for performance.
- Skips type checking and speeds up compilation.
- Forces TypeScript to generate separate .map files.
There are 10 questions to complete.
Take a part in the ongoing discussion