Created
December 1, 2015 18:40
-
-
Save legege/71055dd04b0c89f51d8f to your computer and use it in GitHub Desktop.
Generate chcp.json and chcp.manifest with Gulp
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
// generate chcp.manifest | |
gulp.task('chcp-manifest', ['index'], function() { | |
return gulp.src(['**/*', '!chcp.*'], { cwd: path.join(targetDir, '') }) | |
.pipe(plugins.buster({ fileName: 'chcp.manifest', algo: 'md5', transform: function(hashes) { | |
var transformed = []; | |
for (var file in hashes) { | |
transformed.push({ file: file, hash: hashes[file] }); | |
} | |
return transformed; | |
}})) | |
.pipe(gulp.dest(targetDir)); | |
}); | |
// take care of changing version in chcp.json | |
gulp.task('chcp-config', ['index'], function() { | |
return gulp.src('app/chcp.json') | |
.pipe(plugins.replace('${release}', new Date().toISOString())) | |
.pipe(gulp.dest(targetDir)) | |
.on('error', errorHandler); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment