function javascript() {
  return gulp.src(PATHS.javascript)
    .pipe($.sourcemaps.init())
    .pipe($.babel())
    .pipe($.concat('main.js'))
    .pipe($.if(PRODUCTION, $.uglify()
      .on('error', e => { console.log(e); })
    ))
    .pipe($.if(!PRODUCTION, $.sourcemaps.write()))
    .pipe(gulp.dest(PATHS.dist + '/scripts'));
}
// In production, the file is minified
In production, the file is minified
In production the file is minified
function javascript() {
  return gulp.src(PATHS.javascript)
    .pipe($.sourcemaps.init())
    .pipe($.babel())
    .pipe($.concat('main.js'))
    .pipe($.if(PRODUCTION, $.uglify()
      .on('error', e => { console.log(e); })
    ))
    .pipe($.if(!PRODUCTION, $.sourcemaps.write()))
    .pipe(gulp.dest(PATHS.dist + '/scripts'));
}
function javascript ( ) { return gulp . src ( PATHS . javascript ) . pipe ( $ . sourcemaps . init ( ) ) . pipe ( $ . babel ( ) ) . pipe ( $ . concat ( 'main.js' ) ) . pipe ( $ . if ( PRODUCTION , $ . uglify ( ) . on ( 'error' , e => { console . log ( e ) ; } ) ) ) . pipe ( $ . if ( ! PRODUCTION , $ . sourcemaps . write ( ) ) ) . pipe ( gulp . dest ( PATHS . dist + '/scripts' ) ) ; }
In production, the file is minified
In production the file is minified