mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
New CLI option: exclude
This commit is contained in:
@@ -26,13 +26,6 @@ import { JavaScriptObfuscator } from '../JavaScriptObfuscatorFacade';
|
||||
import { SourceCodeReader } from './utils/SourceCodeReader';
|
||||
|
||||
export class JavaScriptObfuscatorCLI implements IInitializable {
|
||||
/**
|
||||
* @type {string[]}
|
||||
*/
|
||||
public static readonly availableInputExtensions: string[] = [
|
||||
'.js'
|
||||
];
|
||||
|
||||
/**
|
||||
* @type {BufferEncoding}
|
||||
*/
|
||||
@@ -163,7 +156,8 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
|
||||
return this.commands.outputHelp();
|
||||
}
|
||||
|
||||
const sourceCodeData: TSourceCodeData = SourceCodeReader.readSourceCode(this.inputPath);
|
||||
const sourceCodeData: TSourceCodeData = new SourceCodeReader(this.inputCLIOptions)
|
||||
.readSourceCode(this.inputPath, this.inputCLIOptions.exclude);
|
||||
|
||||
this.processSourceCodeData(sourceCodeData);
|
||||
}
|
||||
@@ -244,6 +238,11 @@ export class JavaScriptObfuscatorCLI implements IInitializable {
|
||||
'Blocks the execution of the code in domains that do not match the passed RegExp patterns (comma separated)',
|
||||
ArraySanitizer
|
||||
)
|
||||
.option(
|
||||
'--exclude <list> (comma separated, without whitespaces)',
|
||||
'A filename or glob which indicates files to exclude from obfuscation',
|
||||
ArraySanitizer
|
||||
)
|
||||
.option(
|
||||
'--identifier-names-generator <string> [hexadecimal, mangled]', 'Sets identifier names generator (Default: hexadecimal)',
|
||||
IdentifierNamesGeneratorSanitizer
|
||||
|
||||
Reference in New Issue
Block a user