Angular Blog | Medium
Follow
Using isolatedModules in Angular 18.2
Angular 18.2 introduces TypeScript isolatedModules support, offering significant performance enhancements. By enabling this option, TypeScript code is transpiled via the bundler, resulting in up to 10% faster production build times. The bundler, esbuild, optimizes output code, including inlining enums, and removes Babel optimization passes for TypeScript code. To enable this feature, add "isolatedModules": true to the "compilerOptions" section of your tsconfig.json file. Ensure the "useDefineForClassFields" option is removed or set to true for optimal output size. To learn more, refer to the TypeScript documentation on isolatedModules. By implementing these changes, developers can leverage this feature to improve build performance and create efficient Angular applications.