gulp-pug-template-concat
Compiles Pug templates single file containing template functions. Supports commonJS.
Based on gulp-jade-templates-concat by Nicholas Stonehouse.
Install
$ npm install --save-dev gulp-pug-template-concat
Usage
Gulpfile
var pug = ;var pugConcat = ; gulp
This compiles all of your client side pug templates into a file called mytemplates.js
.
The templateVariable
option is optional and will default to templates
if it is not set.
HTML/Pug
Link the concatenated file with a script tag
script(src="templates/mytemplates.js")
Javascript
Access the generated templates using dot or bracket access notation.
templates'template1'; templatestemplate2;