gulp-dotjs-compiler
Guide
This compiler is mainly based on vohof's gulp-dot
, with a little modification.
There are something changed:
- supports precompiling into javascript: we can compiler doT templates into javascript
- supports other file extensions: we can use a different file extension, such as
dot
jst
, etc.
DEMO
INSTALL
$ npm install gulp-dotjs-compiler
HOW TO USE
/** * deal with js */ var uglify = concat = ; /** * add header and footer */var header = footer = ; var dotCompile = ; gulp; { var begin = '' + '!(function(global, factory) {'+ 'if (typeof define === \'function\' && (define.cmd || define.amd)) {'+ 'define(factory);'+ '} else if (typeof exports !== \'undefined\' && typeof module !== \'undefined\'){'+ 'factory(require, exports, module);'+ '} else {'+ 'var mod = {'+ 'exports: {}'+ '},'+ 'require = function(name) {'+ 'return global[name];'+ '};'+ 'factory(require, mod.exports, mod);'+ 'global.' + modName + '= mod.exports;'+ '}'+ '})(this, function(require, exports, module) {' end = '});' return begin end;}
LINKS
https://github.com/vohof/gulp-dot