{"size": 1276, "ext": "js", "max_stars_repo_path": "gulpfile.js", "max_stars_repo_name": "ninryu/elementary", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "gulpfile.js", "max_issues_repo_name": "ninryu/elementary", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "gulpfile.js", "max_forks_repo_name": "ninryu/elementary", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.6296296296, "max_line_length": 71, "alphanum_fraction": 0.5039184953}
const gulp = require('gulp'),
      sass = require('gulp-sass'),
      uglify = require('gulp-uglify'),
      pump = require('pump'),
      browserSync = require('browser-sync');

gulp.task('sass', (done) => {
  gulp.src('./src/sass/**/*.scss')
    .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
    .pipe(gulp.dest('./assets/css'));
  done();
});

gulp.task('uglify', (cb) => {
  try {
    pump([
        gulp.src('./src/js/**/*.js'),
        uglify({
          compress: {
            collapse_vars: true,
            toplevel: true
          }
        }),
        gulp.dest('./assets/js')
      ],
      cb
    );
  } catch (e) {
   console.log('gulp uglify: ' + e);
  }
});

gulp.task('browser-sync', gulp.series(['sass', 'uglify'], (done) => {
  browserSync.init({
    server: {
      baseDir: './'
    }
  });
  gulp.watch(['./index.html', './assets/**/*'], cb => {
    browserSync.reload();
    cb();
  });
  done();
}));

gulp.task('watcher', () => {
  gulp.watch(['./src/sass/**/*.scss'], gulp.series( 'sass' ));
  gulp.watch(['./src/js/**/*.js'], gulp.series( 'uglify' ));
});

gulp.task('build', gulp.series(['sass', 'uglify']));
gulp.task('watch', gulp.series( ['browser-sync', 'watcher'] ));
gulp.task('default', gulp.series( [ 'watch' ] ));
