Created
February 12, 2014 07:06
-
-
Save basicallydan/8951183 to your computer and use it in GitHub Desktop.
Revisions
-
basicallydan created this gist
Feb 12, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,58 @@ var gulp = require('gulp'); var browserify = require('gulp-browserify'); var concat = require('gulp-concat'); var styl = require('gulp-styl'); var path = require('path'); var o = require('open'); var ripple = require('ripple-emulator'); var webPath = function (p) { return path.join('./www/', p); }; // Builds the scripts based on a single entry point using browserify gulp.task('scripts', function() { gulp.src([webPath('js/index.js')]) .pipe(browserify({ transform: ['hbsfy'], insertGlobals: true })) .pipe(concat('scripts.min.js')) .pipe(gulp.dest(webPath('build'))); }); // Concatenates all the CSS files together. gulp.task('styles', function() { gulp.src([webPath('css/**/*.css')]) .pipe(styl({ compress: true })) .pipe(gulp.dest(webPath('build'))); }); // The default task gulp.task('default', function() { // Watch the JS directory for changes and re-run scripts task when it changes gulp.watch(webPath('js/**'), function(evt) { gulp.run('scripts'); }); // Watch the CSS directory for changes and re-run styles task when it changes gulp.watch(webPath('css/**'), function(evt) { gulp.run('styles'); }); // Run scripts and styles tasks for the first time gulp.run('scripts'); gulp.run('styles'); var options = { keepAlive: false, open: true, port: 4400 }; // Start the ripple server ripple.emulate.start(options); if (options.open) { o('http://localhost:' + options.port + '?enableripple=cordova-3.0.0'); } });