Situations may arise where the user wants Code Hardening to target files with different file size (by default >= 5KB), in order to do that, users can set the --code-hardening-threshold flag through the Jscrambler CLI or the codeHardeningThreshold property on the Jscrambler configuration file.
Use the --code-hardening-threshold=2kb flag on the CLI.
Alternatively, if you want to disable Code Hardening on every file, you can set codeHardeningThreshold to a big value (e.g., 100mb) to make sure that every file in your application is smaller than the threshold.
By setting the codeHardeningThreshold value, even vendor files will be targeted as long as their file size is greater or equal than the set threshold.
For instance, if you want to enforce Code Hardening, add the following code annotation to the beginning of the file:
// @jscrambler global enable codeHardening
In the other hand, if you want to disable it, use this code annotation:
// @jscrambler global disable codeHardening
Default rules are always ignored when using code annotations.