0.0.5 • Published 8 years ago

grunt-template-cache v0.0.5

Weekly downloads
6
License
-
Repository
-
Last release
8 years ago

Cache mustachejs templates

Just a simple grunt file that will save mustachejs templates into a json file.

Add this task

grunt.loadNpmTasks('grunt-template-cache');

Configuration

"template-cache": {
  "html": {
    "glob": "views/**/*.html",
    "dest": "templates.json",
  },
},

This will generate something like:

{
  "path/to/home.html": "<p>{{ value }}</p>",
  //...
}

If you have a source or dist folder (or any other parent folder) that you want to filter out you can use the regex_path_filter

  "html": {
    "glob": "src/views/**/*.html",
    "dest": "templates.json",
    "regex_path_filter": /^src\//i
  },
},

and any src/path/to/file.html will be path/to/file.html

Run it

grunt template-cache:html
0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago