We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Consider JavaScript like this:
class MyClass { constructor(field) { this.field = field; } method() { field++; } get property() { return field; } } var myVar = new MyClass(); myVar.method(); var property = myVar.property;
Then I configure the Uglifier as follows (irrelevant options left out for brevity):
var settings = new CodeSettings { OutputMode = OutputMode.MultipleLines, // Your settings LocalRenaming = LocalRenaming.CrunchAll, PreserveFunctionNames = false, PreserveImportantComments = false, QuoteObjectLiteralProperties = false, RemoveFunctionExpressionNames = true, RemoveUnneededCode = true, RenamePairs = @"MyClass=a,field=b,method=c,property=d,myVar=e", ReorderScopeDeclarations = true, StrictMode = false, StripDebugStatements = true, TermSemicolons = false, WarningLevel = int.MaxValue };
Now, the resulting uglified JavaScript will become (indentation kept for readability):
class a { constructor(b) { this.b = b; } method() { b++; } get property() { return b; } } var e = new a(); e.c(); var d = e.d
This code does not run correctly, as the actual method and property in the class are not renamed, but the locations where they are called are renamed.
To Reproduce See the code example
Minified output or stack trace See the description
Excepted output code
class a { constructor(b) { this.b = b; } c() { b++; } get d() { return b; } } var e = new a(); e.c(); var d = e.d
The text was updated successfully, but these errors were encountered:
As a side note: configuration properties that would rename all global variables and methods and properties of a class would also be great
Sorry, something went wrong.
Thanks for the clear bug report
PRs welcome, the issue will probably lie in one of the Analyzers
Analyzers
No branches or pull requests
Describe the bug
Consider JavaScript like this:
Then I configure the Uglifier as follows (irrelevant options left out for brevity):
Now, the resulting uglified JavaScript will become (indentation kept for readability):
This code does not run correctly, as the actual method and property in the class are not renamed, but the locations where they are called are renamed.
To Reproduce
See the code example
Minified output or stack trace
See the description
Excepted output code
The text was updated successfully, but these errors were encountered: