topLevelVar
- Type:
boolean - Optional
Defined in: options/output-options.ts:629
Whether to use var declarations at the top level scope instead of function / class / let / const expressions.
Enabling this option can improve runtime performance of the generated code in certain environments.
Default
false
In-depth
Multiple JavaScript engines have had and continue to have performance issues with Temporal dead zone (TDZ) checks. These checks validate that a let, const, or class symbol isn't used before it's initialized.
Related issues: