From 463b838567bd04495196fdd77d545a32702b627d Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Tue, 30 Sep 2014 17:54:36 +0900 Subject: [PATCH] Adding build tasks for debug and release --- client/gulpfile.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/client/gulpfile.js b/client/gulpfile.js index e2ecf27..853f9ad 100644 --- a/client/gulpfile.js +++ b/client/gulpfile.js @@ -34,25 +34,36 @@ gulp.task('lint', function() { .pipe(jshint.reporter('default')); }); -gulp.task('scripts', function() { +gulp.task('js', function() { return gulp.src(paths.js) .pipe(concat('scripts.js')) .pipe(uglify()) - .pipe(gulp.dest('dist')); + .pipe(gulp.dest('./dist')); }); -gulp.task('styles', function() { +gulp.task('css', function() { return gulp.src(paths.css) .pipe(concat('styles.css')) .pipe(minifyCss()) - .pipe(gulp.dest('dist')); + .pipe(gulp.dest('./dist')); }); -gulp.task('pages', function() { +gulp.task('html_debug', function() { var sources = gulp.src(paths.js.concat(paths.css), { read: false }); return gulp.src(paths.html) .pipe(inject(sources)) .pipe(gulp.dest('./')); }); -gulp.task('default', ['lint', 'scripts', 'styles', 'pages']); +gulp.task('html_release', function() { + var sources = gulp.src(['./dist/*.js', './dist/*.css'], { read: false }); + return gulp.src(paths.html) + .pipe(inject(sources)) + .pipe(gulp.dest('./')); +}); + + +gulp.task('debug', ['lint', 'html_debug']); +gulp.task('release', ['lint', 'js', 'css', 'html_release']); + +gulp.task('default', ['debug']);