
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
gulp-dotjs-compiler
Advanced tools
This compiler is mainly based on vohof's gulp-dot
, with a little modification.
There are something changed:
dot
jst
, etc.$ npm install gulp-dotjs-compiler
/**
* deal with js
*/
var uglify = require('gulp-uglify'),
concat = require('gulp-concat');
/**
* add header and footer
*/
var header = require('gulp-header'),
footer = require('gulp-footer');
var dotCompile = require('gulp-dotjs-compiler');
gulp.task('dot', function () {
var wrapper = moduleWrap('dotTempl');
gulp.src(['./src/templates/**/*.html', '!./src/templates/layout.html'])
.pipe(dotCompile({
// if we transfered ```it```
// then will compile files into html string
// (如果传了it 则认为是编译为 html)
// it: {data: [2, 4, 5,6]},
// def snippet
// (传过去的 snippet)
def: {xxx: 2222},
// file extension (文件扩展名)
// ext: 'html',
// exposed name
dict: 'dotTempl',
// layout
layout: './src/templates/layout.html'
}))
.pipe(concat('dotTempl.js'))
.pipe(header(wrapper[0] + 'var dotTempl = {};'))
.pipe(footer('module.exports = dotTempl;' + wrapper[1]))
.pipe(uglify())
.pipe(gulp.dest('./build/'));
});
function moduleWrap(modName) {
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];
}
https://github.com/vohof/gulp-dot
FAQs
this is a doT compiler based on gulp-dot
The npm package gulp-dotjs-compiler receives a total of 2 weekly downloads. As such, gulp-dotjs-compiler popularity was classified as not popular.
We found that gulp-dotjs-compiler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.