function buildJS(src, filename, dest, applyHeader, forceIncludePaths) {
  dest = dest || config.dist.jsPath;
  applyHeader = applyHeader || false;
  forceIncludePaths = forceIncludePaths || false;

  return gulp.src(src)
    .pipe(gulpif(
      forceIncludePaths,
      include({
        includePaths: [
          path.dirname(src),
          __dirname,
          config.packagesPath
        ]
      }),
      include()
    ))
    .on('error', console.log) // eslint-disable-line no-console
    .pipe(babel())
    .pipe(uglify({
      output: {
        // try to preserve non-standard headers (e.g. from objectFitPolyfill)
        comments: /^(!|---)/
      }
    }))
    .pipe(gulpif(applyHeader, header(config.prj.header, {
      config: config
    })))
    .pipe(rename(filename))
    .pipe(gulp.dest(dest));
}
// Concat and uglify js files through babel
Concat and uglify js files through babel
Concat and uglify js files through babel
function buildJS(src, filename, dest, applyHeader, forceIncludePaths) {
  dest = dest || config.dist.jsPath;
  applyHeader = applyHeader || false;
  forceIncludePaths = forceIncludePaths || false;
  return gulp.src(src)
    .pipe(gulpif(
      forceIncludePaths,
      include({
        includePaths: [
          path.dirname(src),
          __dirname,
          config.packagesPath
        ]
      }),
      include()
    ))
    .on('error', console.log) 
    .pipe(babel())
    .pipe(uglify({
      output: {
        comments: /^(!|---)/
      }
    }))
    .pipe(gulpif(applyHeader, header(config.prj.header, {
      config: config
    })))
    .pipe(rename(filename))
    .pipe(gulp.dest(dest));
}
function buildJS ( src , filename , dest , applyHeader , forceIncludePaths ) { dest = dest || config . dist . jsPath ; applyHeader = applyHeader || false ; forceIncludePaths = forceIncludePaths || false ; return gulp . src ( src ) . pipe ( gulpif ( forceIncludePaths , include ( { includePaths : [ path . dirname ( src ) , __dirname , config . packagesPath ] } ) , include ( ) ) ) . on ( 'error' , console . log ) . pipe ( babel ( ) ) . pipe ( uglify ( { output : { comments : / ^(!|---) / } } ) ) . pipe ( gulpif ( applyHeader , header ( config . prj . header , { config : config } ) ) ) . pipe ( rename ( filename ) ) . pipe ( gulp . dest ( dest ) ) ; }
Concat and uglify js files through babel
Concat and uglify js files through babel
// eslint-disable-line no-console // try to preserve non-standard headers (e.g. from objectFitPolyfill)