grunt-jp-swig

0.1.4 • Public • Published

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>]({});

Readme

Keywords

none

Package Sidebar

Install

npm i grunt-jp-swig

Weekly Downloads

1

Version

0.1.4

License

none

Last publish

Collaborators

  • johnpitcher