Skip to main content
Update because the type based optimizations are now enabled by default.
Source Link
Chad Killingsworth
  • 14.4k
  • 2
  • 36
  • 58

General Closure Compiler Debugging Tips

  • Use the VERBOSE warning level. This turns on all of the checks.
  • Use the debug flag. It makes renamed symbols ridiculously long, but they are named in such a way you can find the original. If code works with the debug flag but not without it, it is almost certainly a renaming issue.
  • Definitely use formatting=PRETTY_PRINT. Debugging compacted code is painful without it.
  • Use source maps
  • Disable the type based optimizations with --use_types_for_optimization false. Incorrect type annotations can cause the compiler to make invalid assumptions.

UPDATE: As of the 20150315 compiler release, the type based optimizations are enabled by default.

General Closure Compiler Debugging Tips

  • Use the VERBOSE warning level. This turns on all of the checks.
  • Use the debug flag. It makes renamed symbols ridiculously long, but they are named in such a way you can find the original. If code works with the debug flag but not without it, it is almost certainly a renaming issue.
  • Definitely use formatting=PRETTY_PRINT. Debugging compacted code is painful without it.
  • Use source maps

General Closure Compiler Debugging Tips

  • Use the VERBOSE warning level. This turns on all of the checks.
  • Use the debug flag. It makes renamed symbols ridiculously long, but they are named in such a way you can find the original. If code works with the debug flag but not without it, it is almost certainly a renaming issue.
  • Definitely use formatting=PRETTY_PRINT. Debugging compacted code is painful without it.
  • Use source maps
  • Disable the type based optimizations with --use_types_for_optimization false. Incorrect type annotations can cause the compiler to make invalid assumptions.

UPDATE: As of the 20150315 compiler release, the type based optimizations are enabled by default.

Added another tip per John's comment
Source Link
Chad Killingsworth
  • 14.4k
  • 2
  • 36
  • 58

General Closure Compiler Debugging Tips

  • Use the VERBOSE warning level. This turns on all of the checks.
  • Use the debug flag. It makes renamed symbols ridiculously long, but they are named in such a way you can find the original. If code works with the debug flag but not without it, it is almost certainly a renaming issue.
  • Definitely use formatting=PRETTY_PRINT. Debugging compacted code is painful without it.
  • Use source maps

General Closure Compiler Debugging Tips

  • Use the VERBOSE warning level. This turns on all of the checks.
  • Use the debug flag. It makes renamed symbols ridiculously long, but they are named in such a way you can find the original. If code works with the debug flag but not without it, it is almost certainly a renaming issue.
  • Definitely use formatting=PRETTY_PRINT. Debugging compacted code is painful without it.

General Closure Compiler Debugging Tips

  • Use the VERBOSE warning level. This turns on all of the checks.
  • Use the debug flag. It makes renamed symbols ridiculously long, but they are named in such a way you can find the original. If code works with the debug flag but not without it, it is almost certainly a renaming issue.
  • Definitely use formatting=PRETTY_PRINT. Debugging compacted code is painful without it.
  • Use source maps
Added clarification.
Source Link
Chad Killingsworth
  • 14.4k
  • 2
  • 36
  • 58

General Closure Compiler Debugging Tips

  • Use the VERBOSE warning level. This turns on all of the checks.
  • Use the debug flag. It makes renamed symbols ridiculously long, but they are named in such a way you can find the original. If code works with the debug flag but not without it, it is almost certainly a renaming issue.
  • Definitely use formatting=PRETTY_PRINT. Debugging compacted code is painful without it.

General Closure Compiler Debugging Tips

  • Use the VERBOSE warning level. This turns on all of the checks.
  • Use the debug flag. It makes renamed symbols ridiculously long, but they are named in such a way you can find the original.
  • Definitely use formatting=PRETTY_PRINT. Debugging compacted code is painful without it.

General Closure Compiler Debugging Tips

  • Use the VERBOSE warning level. This turns on all of the checks.
  • Use the debug flag. It makes renamed symbols ridiculously long, but they are named in such a way you can find the original. If code works with the debug flag but not without it, it is almost certainly a renaming issue.
  • Definitely use formatting=PRETTY_PRINT. Debugging compacted code is painful without it.
Source Link
Chad Killingsworth
  • 14.4k
  • 2
  • 36
  • 58
Loading