text: var gulp        = require('gulp');
  var gutil       = require('gulp-util');
  var source      = require('vinyl-source-stream');
  var babelify    = require('babelify');
  var watchify    = require('watchify');
  var exorcist    = require('exorcist');
  var browserify  = require('browserify');
  var browserSync = require('browser-sync').create();
  var sass        = require('gulp-sass');
  var reload      = browserSync.reload;
  
  var src = {
      scss: 'app/scss/*.scss',
      css:  'app/css',
      html: 'app/*.html'
  };
  
  
  // Input file.
  watchify.args.debug = true;
  var bundler = watchify(browserify('./app/js/app.js', watchify.args));
  
  // Babel transform
  bundler.transform(babelify.configure({
      sourceMapRelative: 'app/js',
  	blacklist: "regenerator"
  }));
  
  // On updates recompile
  bundler.on('update', bundle);
  
  function bundle() {
  
      gutil.log('Compiling JS...');
  
      return bundler.bundle()
          .on('error', function (err) {
              gutil.log(err.message);
              browserSync.notify("Browserify Error!");
              this.emit("end");
          })
          .pipe(exorcist('app/js/dist/bundle.js.map'))
          .pipe(source('bundle.js'))
          .pipe(gulp.dest('./app/js/dist'))
          .pipe(browserSync.stream({once: true}));
  }
  
  /**
   * Gulp task alias
   */
  gulp.task('bundle', function () {
      return bundle();
  });
  
  
  // Compile sass into CSS
  gulp.task('sass', function() {
      return gulp.src(src.scss)
          .pipe(sass())
          .pipe(gulp.dest(src.css))
          .pipe(reload({stream: true}));
  });
  
  
  /**
   * First bundle, then serve from the ./app directory
   */
  gulp.task('default', ['bundle', 'sass'], function () {
      browserSync.init({
          server: "./app"
      });
  	
  	gulp.watch(src.scss, ['sass']);
      gulp.watch(src.html).on('change', reload);
  });
  
  