{"size": 1041, "ext": "js", "max_stars_repo_path": "gulpfile.babel.js", "max_stars_repo_name": "stefanwalther/es6-boilerplate", "max_stars_repo_stars_event_min_datetime": "2017-03-05T02:46:57.000Z", "max_stars_repo_stars_event_max_datetime": "2020-01-30T15:54:57.000Z", "max_issues_repo_path": "gulpfile.babel.js", "max_issues_repo_name": "stefanwalther/es6-boilerplate", "max_issues_repo_issues_event_min_datetime": "2018-10-31T14:39:48.000Z", "max_issues_repo_issues_event_max_datetime": "2018-12-09T11:29:59.000Z", "max_forks_repo_path": "gulpfile.babel.js", "max_forks_repo_name": "stefanwalther/es6-boilerplate", "max_forks_repo_forks_event_min_datetime": "2016-12-16T13:59:04.000Z", "max_forks_repo_forks_event_max_datetime": "2017-09-25T13:35:38.000Z"}
{"max_stars_count": 10, "max_issues_count": 7, "max_forks_count": 6, "avg_line_length": 23.6590909091, "max_line_length": 70, "alphanum_fraction": 0.553314121}
import gulp from 'gulp';
import sourceMaps from 'gulp-sourcemaps';
import babel from 'gulp-babel';
import path from 'path';
import del from 'del';

const paths = {
  es6Path: './src/**/*.*',
  es6: [ './src/**/*.js', '!./src/**/*.json' ],
  es5: './dist',
  // Must be absolute or relative to source map
  sourceRoot: path.join( __dirname, 'src' )
};

gulp.task( 'clean:dist', () => {
  return del( [
    './dist/**/*'
  ] );
} );

gulp.task( 'build', [ 'clean:dist', 'copy:nonJs' ], () => {
  return gulp.src( paths.es6 )
    .pipe( sourceMaps.init() )
    .pipe( babel( {
      presets: [ 'es2015' ]
    } ) )
    .pipe( sourceMaps.write( '.', { sourceRoot: paths.sourceRoot } ) )
    .pipe( gulp.dest( paths.es5 ) );
} );

// Copy all the non JavaScript files to the ./dist folder
gulp.task( 'copy:nonJs', () => {

  return gulp.src( [ paths.es6Path, '!' + paths.es6 ] )
    .pipe( gulp.dest( paths.es5 ) )

} );

gulp.task( 'watch', [ 'build' ], () => {
  gulp.watch( paths.es6, [ 'build' ] );
} );

gulp.task( 'default', [ 'watch' ] );
