javajavascriptparsinggoogle-closure-compilerplovr

How to make a plugin for Google Closure


I am currently using Closure/Plovr advanced mode to compile javascript.

I want to add some custom functionality, such as string replacements and variable renaming. The important thing is that it requires parsed syntax.

Is it possible to add this functionality? Is there an API for this or do I have to dive into the Closure code (which I don't really want to do).


Solution

  • There are no plugins for Closure-compiler. If the optimization does not exist, you would need to write it as a custom pass for the compiler.