gulp-define-golang-template
gulp-define-golang-template is a Gulp extension to define a golang template to files in the pipeline.
Install
npm install --save-dev gulp-define-golang-template
Usage
gulpfile.js
var defineTpl = require('gulp-define-golang-template');
gulp.src('./js/foo.js')
.pipe(defineTpl())
.pipe(gulp.dest('./dist/'))
gulp.src('./css/bar.css')
.pipe(defineTpl())
.pipe(gulp.dest('./dist/'))
./dist/foo.js
{{define "foo.js"}}
(function () {
alert('Hello world!')
}());
{{end}}
./dist/bar.css
{{define "bar.css"}}
body {
font-size: 16px;
}
{{end}}