Add require js wrapper to soy templates through a grunt task

npm install soy-to-require
4 downloads in the last month


A simple grunt task to wrap compiled soy templates with require.

Getting Started

This plugin requires Grunt '~0.4.x'

Soy must be included in your require config. Example:

      baseUrl: 'js/',
      paths: {
        "soy": ""
      shim: {
        "soy": {
            exports: "soy"
npm install soy-to-require --save-dev


To use this task add this config to the Gruntfile

'soy-to-require': {
    namespace: 'TemplateNamespace',
    templates: 'path/to/compiled/templates'

For this to work the template file name has to be the same as the template name. For example:

{namespace HelloWorld}
* Some random template
* @param world
{template .exampleTemplate}
    Hello {$world}

The filename would be ''.

Any questions? tweet me @charliedowler

npm loves you