0.0.2 • Published 9 years ago

gulp-dot-commonjs-compile v0.0.2

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

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 ...
...
});