mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
Applying optimize-js for obfuscated code
This commit is contained in:
@@ -7,6 +7,8 @@ import { IGeneratorOutput } from "./interfaces/IGeneratorOutput";
|
||||
import { IObfuscationResult } from "./interfaces/IObfuscationResult";
|
||||
import { IOptions } from './interfaces/IOptions';
|
||||
|
||||
import { SourceMapMode } from "./enums/SourceMapMode";
|
||||
|
||||
import { ObfuscationResult } from "./ObfuscationResult";
|
||||
import { Obfuscator } from "./Obfuscator";
|
||||
import { Options } from "./options/Options";
|
||||
@@ -70,7 +72,9 @@ export class JavaScriptObfuscatorInternal {
|
||||
const generatorOutput: IGeneratorOutput = escodegen.generate(astTree, escodegenParams);
|
||||
|
||||
if (options.optimize) {
|
||||
generatorOutput.code = optimizeJs(generatorOutput.code);
|
||||
generatorOutput.code = optimizeJs(generatorOutput.code, {
|
||||
sourceMap: options.sourceMap && options.sourceMapMode === SourceMapMode.Inline
|
||||
});
|
||||
}
|
||||
|
||||
generatorOutput.map = generatorOutput.map ? generatorOutput.map.toString() : '';
|
||||
|
||||
Reference in New Issue
Block a user