From 62f13c5f678e691b1900b04f2b4b921eb0c5bfd8 Mon Sep 17 00:00:00 2001 From: Amio Date: Tue, 25 Feb 2014 16:19:26 +0800 Subject: [PATCH] =?UTF-8?q?WA=E4=BB=A3=E7=A0=81=EF=BC=9A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20gulpfile.js=20=E5=88=86=E6=AE=B5=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 6fa482a..477748a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -6,6 +6,10 @@ var tinylr = require('tiny-lr'); var connectlr = require('connect-livereload'); var open = require('open'); +/************************************** + * Launch Local Servers + */ + var LIVERELOAD_PORT = 35729; var EXPRESS_PORT = 9999; var SOURCE_ROOT = __dirname + '/app'; @@ -56,6 +60,10 @@ gulp.task('serverdist', function () { open('http://localhost:9999'); }); +/************************************** + * Building Works + */ + //var sass = require('gulp-ruby-sass'); //var jshint = require('gulp-jshint'); @@ -77,7 +85,7 @@ gulp.task('usemin', function () { .pipe(gulp.dest('./dist/')); }); -gulp.task('imagemin', function(){ +gulp.task('imagemin', function () { gulp.src(SOURCE_ROOT + '/images/*.*', {base: SOURCE_ROOT}) .pipe(imagemin()) .pipe(gulp.dest(BUILD_ROOT)); @@ -110,6 +118,10 @@ gulp.task('build', ['clean'], function () { gulp.start('usemin', 'imagemin', 'copy'); }); +/************************************** + * Distribution + */ + var sh = function (commands) { var exec = require('child_process').exec; var sys = require('sys'); @@ -130,4 +142,8 @@ gulp.task('dist', function () { + ' -avz -e ssh --delete --exclude=.git* --exclude=*.scss --exclude=node_modules'); }); +/************************************** + * General Tasks + */ + gulp.task('default', ['serverdev']);