Created
February 14, 2015 23:32
-
-
Save alexey-sh/cff195650274c6e021a1 to your computer and use it in GitHub Desktop.
gulp ejs precompile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ejs = require('gulp-ejs-precompiler'); | |
var concat = require('gulp-concat'); | |
var gulp = require('gulp'); | |
var insert = require('gulp-insert'); | |
gulp.task('default', function() { | |
return gulp.src("./app/templates/*.ejs") | |
.pipe(ejs({ | |
compileDebug: true, | |
client: true | |
})) | |
.pipe(concat('templates.js')) | |
.pipe(insert.wrap('define("templates", [], function () { var templates = {};'+"\n", "return templates;\n});")) | |
.pipe(gulp.dest("./app/templates")); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment