google / google/closure-compiler

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

Open
#3,900 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

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`?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.