module.exports = function (gulp, plugins, config, env) { return function html() { return gulp.src(env.production() ? config.build + '/*.html' : 'html/*.html') .pipe(plugins.inject(gulp.src(['config.json']), { starttag: '', transform: function (filePath, file) { return '' ; } })) .pipe(env.production(plugins.kyhInlineSource({ compress: false }))) .pipe(plugins.cacheBust({ type: 'timestamp' })) .pipe(plugins.htmlmin({ removeComments: true, collapseWhitespace: true, minifyJS: true })) .pipe(gulp.dest(config.build)); }; };