I am using terser to compress my code. But it turns out that it removes a function that is called only in html code (I understand that I set module: true)
I also set dead_code: false to keep unreachable code from being removed, but that didn't change anything at all, the function is still removed
What should I do?
Here are my options:
{
compress: {
drop_console: true,
drop_debugger: false,
dead_code: false,
},
mangle: {
reserved: ["getUserStats"],
},
module: true,
toplevel: true,
keep_fnames: false
}
Even when I call the function in another file that is also used in minification, the function is removed. What the hell???
Ok, I did this and it worked: