bolinfest / plovr

plovr: a Closure build tool
78 stars 48 forks source link

Add "print-config" configuration option. #144

Closed kigh-ota closed 6 years ago

kigh-ota commented 6 years ago

Hi @nicks,

This adds an option that corresponds to Closure Compiler's printConfig option. By enabling this, Closure Compiler will dump its configuration options on stderr, which may be useful for checking what changes each configuration option of plovr actually result in.

nicks commented 6 years ago

can you elaborate a bit on the use case for this? This seems like a weird option to include in Plovr serve mode. maybe it should be a flag for Plovr build mode?

kigh-ota commented 6 years ago

Thank you for the comments!

This is my own use case: I changed some Plovr options (language-in and language-out). With this, I hoped that only the transpilation feature of Closure Compiler is enabled, no other Closure Compiler's options are changed (to minimize the risk of degradation). I wanted to make sure of this, but there seemed to be no way of dumping Closure Compiler's options by changing Plovr's configuration options. So I built a patched version of Plovr with Closure Compiler's printConfig option enabled. If the printConfig option can be specified directly from Plovr, I can more quickly check the Closure Compiler's options.

Also, this option can be used to know the default values for Closure Compiler's options (for instance, if language-in option is not set in Plovr config file, what will be the value of Closure Compiler's languageIn option?)

This seems like a weird option to include in Plovr serve mode. maybe it should be a flag for Plovr build mode?

That's right... the option is only necessary in build mode. I added a commit such that the option is only available in build mode and can be specified on the command line. https://github.com/bolinfest/plovr/pull/144/commits/77306b8676aa38cc59ddae3d245bc7cee660d316

nicks commented 6 years ago

ah, sorry for the delay, i thought i had merged this already. lgtm!

kigh-ota commented 6 years ago

Many thanks!