'use strict'

const $ = require('gulp-load-plugins')()

const config = require('../../config/babel')

module.exports = {
  dep: ['clean:node'],
  fn (gulp, done) {
    return gulp.src('src/**/*.js')
      .pipe($.babel(config))
      .pipe($.size())
      .pipe(gulp.dest('lib'))
  }
}

'use strict'

const $ = require('gulp-load-plugins')()
const runSequence = require('run-sequence')

const config = require('../../config/babel')

module.exports = {
  dep: ['clean:node'],
  fn (gulp, done) {
    gulp.task('copy::node', () => {
      return gulp.src('src/**/*')
        .pipe($.size())
        .pipe(gulp.dest('lib'))
    })

    gulp.task('build::node', () => {
      return gulp.src('src/**/*.js')
        .pipe($.babel(config))
        .pipe($.size())
        .pipe(gulp.dest('lib'))
    })

    runSequence.use(gulp)(
      'copy::node',
      'build::node',
      done
    )
  }
}

Copy all files, not only js files when building for node