Last active

Sublime Text 2 - Google Closure Template Builder

  • Download Gist
Google Closure (Soy).sublime-build
1 2 3 4
"cmd": ["java", "-jar", "../SoyToJsSrcCompiler.jar", "--outputPathFormat", "../${file_base_name}.js", "${file}"],
"selector": ""

First, if it's not already in your repository, get the Google Closure Template compiler at their documentation website:
or the direct link:

Create a new Sublime Text 2 build system (Tools > Build System > New Build System...), pasting in the code above.

Set the 3rd "cmd" item in the sublime-build file to reflect the compiler location.

NOTE: With the current setup, it will build any .soy file into a .js file and place it in the parent folder. This is perfect for having a site structure like this:


Also, I recommend downloading SublimeOnSaveBuild ( to automatically build your soy files on save. For this to work properly you will need to add ".soy" extensions to your package settings (

For syntax highlighting, add the package repository and install SoyTemplate

For the required comment syntax snippets, install the DocBlockr package

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.