concat jst file to module's js file for gulp
npm install gulp-concat-jst --save-dev
gulp.task('jst-concat', function(){
return gulp.src("fixtures/modules/*.js")
.pipe(jst_concat({
separator_start: '/**start**/',
separator_end: '/**end**/',
jst_path: 'build/template/',
jst_ext: ".js",
pattern: /CustomGetTemplateFn\s*\(\'(.*?).html\'\)/g,
replace: function(jst, tmpFile){
return `this["ajst"] = this["ajst"] || {};this["ajst"]["${tmpFile}"] = ${jst}`;
}
}))
.pipe(gulp.dest("build/modules"))
});
Type: String
Default value: ''
A string value that is used to do something with whatever.
Type: String
Default value: ''
A string value that is used to do something with whatever.
Type: String
Default value: 'tmp/template/'
compiled jst template path
Type: String
Default value: '.jst'
jst template extension
Type: String
Default value: '/CustomGetTemplateFn\s*\(\'(.*?).html\'\)/g'
A regex pattern that is used to get template path list
Type: String
Default value: '$1'
A string value that is used to replace template name
Type: Function
Default value: null
A function that is used to do something you want.