Skip to content

lukezhang001/gulp-dot-commonjs-compile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Gulp plugin for precompilation of doT templates.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published