I'm using Google's Closure Compiler to reduce the size of my Java Script code. Unfortunately the Closure Compiler does also change ALL function names in the Advanced mode without an easy option to change that.
I do need to exclude functions that are defined as properties (eg car.bla = function()
) completely. This includes the ones that I use and that are not defined at all in the local code, and the ones that I define myself.
I know that there is externs and exports (although I don't fully understand them) but I do not want to have to keep maintaining any extra files beside my code.
I would also be find to exclude any functions (also non-property functions).
After googling for a few hours I've still not found an options for that.
There are a few answers here;
@export
to label a property as "used by external sources", such as an Angular binding. externs
. These are used when you have code that is compiled separately from your code, but they need to interact. Have a look at how simple Angular's externs are. WHITESPACE_ONLY
--property_renaming=ALL_UNQUOTED
and use foo['bar']
to access foo.bar
--property_renaming=OFF
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.