minify option and variable declarations merge transformer

This commit is contained in:
sanex3339
2020-06-26 12:41:01 +03:00
parent 3a202aa2d8
commit 1d86852e45
19 changed files with 166 additions and 20 deletions
+6
View File
@@ -81,6 +81,7 @@ export class JavaScriptObfuscator implements IJavaScriptObfuscator {
NodeTransformer.ScopeIdentifiersTransformer,
NodeTransformer.SplitStringTransformer,
NodeTransformer.TemplateLiteralTransformer,
NodeTransformer.VariableDeclarationsMergeTransformer,
NodeTransformer.VariablePreserveTransformer
];
@@ -215,6 +216,11 @@ export class JavaScriptObfuscator implements IJavaScriptObfuscator {
astTree = this.runNodeTransformationStage(astTree, NodeTransformationStage.Converting);
astTree = this.runNodeTransformationStage(astTree, NodeTransformationStage.Obfuscating);
if (this.options.minify) {
astTree = this.runNodeTransformationStage(astTree, NodeTransformationStage.Minification);
}
astTree = this.runNodeTransformationStage(astTree, NodeTransformationStage.Finalizing);
return astTree;