Answer the question
In order to leave comments, you need to log in
Is it possible to minify the names of public methods of inner classes through Terser?
There are two classes, the first is used in the second, the second is exported.
//file1.js
export default class Foo{
publicVarFoo = 1;
#privateVarFoo = 2;
publicMethodFoo(){}
#privateMethodFoo(){}
}
//file2.js, entrypoint
import Foo from "./file1.js"
export default class Bar{
constructor(){
this.foo = new Foo();
}
publicVarBar = 1;
#privateVarBar = 2;
publicMethodBar(){
this.foo.publicMethodFoo();
console.log(this.foo.publicVarFoo );
}
#privateMethodBar(){}
}
terserOptions: {
mangle: {
properties: {
regex: /^_/,
}
},
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question