gulp-tpl2json

0.0.3 • Public • Published

gulp-tpl2json

Make template files into JSON

Install

$ npm install --save-dev gulp-tpl2json

Usage

src/test1.tpl

<h1>Hello <%= name %></h1>

src/test2.tpl

<header>template <%= path %></header>

gulpfile.js

var gulp = require('gulp');
var tpl2json = require('gulp-tpl2json');
 
gulp.task('default', function () {
    return gulp.src('src/greeting.html')
        .pipe(tpl2json('template.js'/*, {newLine:'\n', expression:'var a = '}*/))
        .pipe(gulp.dest('dist'));
});

dist/template.js

{"test1.tpl":"<h1>Hello Sindre</h1>","test2.tpl":"<header>template <%= path %></header>"}

Notes

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i gulp-tpl2json

Weekly Downloads

3

Version

0.0.3

License

MIT

Last publish

Collaborators

  • valleykid