Created
November 2, 2016 15:47
-
-
Save skippy123/9e72ef814ece2912313747b63428baeb to your computer and use it in GitHub Desktop.
gulp task debugging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var through = require('through2') | |
.pipe(through.obj(function (chunk, enc, cb) { | |
console.log(chunk._contents.toString()) | |
cb(null, chunk) | |
})) | |
function buildUserscript() { | |
// Helpers | |
gutil.log('Building userscript'); | |
clean(); | |
createRuntimeCfg(); | |
wPack(cfg); | |
const usCfg = cfg.userscript; | |
usCfg.serverAddr = usCfg.output.updateURL; | |
usCfg.version = getHeaderVerNumber(); | |
// Usage | |
gulp.src([usCfg.templates.header, usCfg.templates.main]) | |
.pipe(concat(usCfg.output.name)) | |
.pipe(hbs(usCfg)) | |
.pipe(hbs({ | |
injectionScript: fs.readFileSync(usCfg.templates.injectionScript, 'utf-8'), | |
url: usCfg.endpoints.buildpath, | |
script_name: usCfg.name, | |
})) | |
.pipe(through.obj(function (chunk, enc, cb) { | |
console.log(chunk._contents.toString()) | |
cb(null, chunk) | |
})) | |
.pipe(gulp.dest(cfg.src.output.dist)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment