closure-compiler icon indicating copy to clipboard operation
closure-compiler copied to clipboard

Do not minify any symbols that contain a substring (or match a regex?), or custom minification rules?

Open juj opened this issue 2 years ago • 0 comments

Over at the Emscripten repository, we found a situation where we would like to instruct Closure not to minify any JS symbols that contain the substring __asyncjs__ in them.

Or if they are minified, they would like to be minified to a name that still retains the substring __asyncjs__ in them.

I was not able to find an existing option that would help here. The externs file allows one to specify full function names for symbols that should not be minified, but it does not lend to using a wildcard pattern or a regex pattern.

Maybe users could somehow specify these kinds of substrings or regex rules that would prevent minification.

Or maybe one method might be to allow user to register custom minification functions, that would still allow users to manually specify a minification, e.g. write a function that would do a transform __asyncjs__my_function_name -> __asyncjs__a?

juj avatar Dec 13 '21 11:12 juj