gulp-dot-commonjs-compile
v0.0.2
Published
Gulp plugin for precompilation of doT templates.
Downloads
1
Maintainers
Readme
gulp-dot-commonjs-compile
Gulp plugin for precompilation of doT templates.
Example
If we have following folder structure:
src/list.html:
<script type="text/template" id="mainTpl">
...
</script>
<script type="text/template" id="detailTpl">
...
</script>
Then, running this code:
gulp.task('templates', function() {
gulp.src('src/*.html')
.pipe(dotCompile())
.pipe(rename(function (path) {
path.extname = ".js"
}))
.pipe(gulp.dest('dest'));
});
Will produce dest/list.js:
define("list",function(require,exports,module){
exports.mainTpl =function ...
exports.detailTpl =function ...
...
});