javascript - Closure Compiler: How to separate and control compilation/minification passes? -


the google closure compiler powerful compiler , minifier js, gives lot of optimization options such renaming variables, removing dead codes, collapsing variable declarations, rewriting control flow structures , etc.

what want separately apply 1 or of these optimizations on input js program. example, may want rename variables short names, not remove dead codes. how can achieve kind of detailed compilation pass control? source code of cc expose specific interfaces customization, or should write own pass(if so, how supposed start?).

the command line features offer several options controlling compilation, insufficient fit want above. since source code kinda complicated , few detailed design documentation can found, stuck here. insights appreciated, :)

take @ defaultpassconfig. class lists passes run during compilation, based on options set in compileroptions. of compileroptions can controlled command line, try keep compiler relatively simple , easy use, , not ask users make decisions bunch of different compiler flags. plus, there passes increase code size, in such way makes easier later pass decrease afterwards.

of course if you're experimenting compiler or trying understand how works, can turn on , off whichever passes want, either adding new flags, or modifying defaultpassconfig directly.


Comments

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

javascript - Using jquery append to add option values into a select element not working -