Swig templates compilation
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tasks
test
.gitignore
.jshintrc
.travis.yml
Gruntfile.js
LICENSE
README.md
package.json

README.md

grunt-jp-swig Build Status

Swig templates compilation

Sample configuration:

"swig-browser": {
  frontTemplates:{
    options:{

      // window.<namespace>
      namespace: 'SWIG',

      // see: http://paularmstrong.github.io/swig/docs/api/#SwigOpts
      templateSettings: {},

      // see: http://perfectionkills.com/experimenting-with-html-minifier/#options
      htmlMinifySettings: {},

      amd: false,
      
      // init as a parent template
      layout: false,

      prettify: false,

      // attach swig browser env to a template function
      processor: false, 

      // modify template function source code 
      processContent: function(src) { return src; },

      // modify template name
      processName: function(name) { return name; },

      // additional filter list 
      filters:[]
    },

    files:{ 'dest.js': ['templates/**/*.swig'] }
  }	
}

In browser:

  var html = window.SWIG[<template name>]({});