text: var gulp = require("gulp");
  var sourcemaps = require("gulp-sourcemaps");
  var babel = require("gulp-babel");
  var concat = require("gulp-concat");
  var minify = require("gulp-minify");
  const eslint = require('gulp-eslint');
  var webpackStream = require('webpack-stream');
  var webpack2 = require('webpack');
  
  
  gulp.task("default", function () {
    return gulp.src("src/**/*.js")
      .pipe(sourcemaps.init())
      .pipe(babel({
              presets: ['react','es2015']
          }))
      .pipe(concat("all.js"))
      .pipe(sourcemaps.write("."))
      .pipe(gulp.dest("dist"));
  });
  
  gulp.task('wpdefault', function() {
    return gulp.src('src/dummy.js')
      .pipe(webpackStream(require('./webpack.config.js'), webpack2))
      .pipe(gulp.dest('dist/'));
  });
  
  gulp.task('compress', function() {
    gulp.src('dist/**/*.js')
      .pipe(minify({
          ext:{
              src:'.js',
              min:'.min.js'
          },
          exclude: ['tasks'],
          ignoreFiles: ['.combo.js', '-min.js']
      }))
      .pipe(gulp.dest('dist'))
  });
  
  gulp.task('lint', () => {
      // ESLint ignores files with "node_modules" paths.
      // So, it's best to have gulp ignore the directory as well.
      // Also, Be sure to return the stream from the task;
      // Otherwise, the task may end before the stream has finished.
      return gulp.src(['src/**','!node_modules/**'])
          // eslint() attaches the lint output to the "eslint" property
          // of the file object so it can be used by other modules.
          .pipe(eslint())
          // eslint.format() outputs the lint results to the console.
          // Alternatively use eslint.formatEach() (see Docs).
          .pipe(eslint.format())
          // To have the process exit with an error code (1) on
          // lint error, return the stream and pipe to failAfterError last.
          .pipe(eslint.failAfterError());
  });
  
  