0.0.6 • Published 8 years ago

gulp-jqtmpl v0.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

gulp-jqtmpl

Compile jQuery templates with Gulp

Installation

npm install -save gulp-jqtmpl

Usage

    var gulp = require('gulp');
    var compile = require('gulp-jqtmpl');

    gulp.task('CompileTemplates', function () {
        gulp.src('./templates.html')
            .pipe(compile({/* options */}))
            .pipe(gulp.dest('./templates.js'));

    });

Compile separate templates file into one file

Use gulp-concat to combine all of your template files before compiling.

    var gulp = require('gulp');
    var compile = require('gulp-jqtmpl');
    var concat = require('gulp-concat');

    gulp.task('CompileTemplates', function () {
        gulp.src('./templates/*.html')
            .pipe(concat('combinedTemplates.html'))
            .pipe(compile({/* options */}))
            .pipe(gulp.dest('./templates.js'));

    });

Options

  • map function(object): string - This function takes an object containing the name of the template and the template function and returns the string written to the file. By default this function uses the exports object
        exports['<template_name>'] = <template_function>;
  • prefix string - A string to start the file with. Default is null.

  • suffix string - A string to end the file with. Default is null.

License

gulp-jqtmpl is Copyright (c) 2015 Ryan Turnquist and licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved.

0.0.6

8 years ago

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