var gulp = require('gulp');
var webpack = require('webpack-stream');
var browserSync = require('browser-sync');
var stream = browserSync.stream;
var ghpages = require('gh-pages');
var path = require('path');
var del = require('del');
var concatCSS = require('gulp-concat-css');
var gutil = require('gulp-util');
var template = require('gulp-template');

var buildOut = 'build/';
const config = {
    web: {
        scripts: 'src/js/**/*',
        styles: 'src/css/*',
        images: 'src/icons/*',
        index: 'src/index.html',
        webpack: {
            main: 'src/js/main.js',
            watch: false,
            output: {filename: 'main.js'},
            devtool: 'sourcemap',
            resolve: {
                modulesDirectories: ['node_modules', './src/js']
            }
        },
        dest: buildOut + 'web',
    },
    plugin: {
        chrome: {
            scripts: 'chrome/**/*',
            dest: buildOut + 'plugin/chrome',
        }
    },
    dest: buildOut,
    production: false,
};

gulp.task('clean', function () {
    return del([buildOut]);
});

gulp.task('scripts', function () {
    return gulp.src(config.web.webpack.main)
        .pipe(webpack(config.web.webpack))
        .pipe(gulp.dest(config.web.dest)).pipe(stream());
});

gulp.task('styles', function () {
    return gulp.src([config.web.styles])
        .pipe(config.production ? concatCSS('style.css') : gutil.noop())
        .pipe(gulp.dest(config.web.dest)).pipe(stream());
});

gulp.task('images', function () {
    return gulp.src(config.web.images).pipe(gulp.dest(config.web.dest));
});

gulp.task('index', function () {
    return gulp.src(config.web.index)
        .pipe(template(config.web.webpack))
        .pipe(gulp.dest(config.web.dest)).pipe(stream());
});

gulp.task('static:web', ['styles', 'scripts', 'images', 'index']);

gulp.task('server', ['static:web'], function () {
    browserSync({
        server: {
            baseDir: config.web.dest
        }
    });
});

gulp.task('watch', ['server'], function () {
    gulp.watch(config.web.scripts, ['scripts']);
    gulp.watch(config.web.styles, ['styles']);
    gulp.watch(config.web.index, ['index']);
});

gulp.task('build:web', ['static:web']);

gulp.task('static:chrome', function () {
    return gulp.src(config.plugin.chrome.scripts)
        .pipe(gulp.dest(config.plugin.chrome.dest));
});

gulp.task('build:chrome', ['build:web', 'static:chrome'], function () {
    return gulp.src(config.web.dest + '/*.*')
        .pipe(gulp.dest(config.plugin.chrome.dest + '/popup'));
});

gulp.task('publish', ['build:web'], function (end) {
    ghpages.publish(path.join(__dirname, config.web.dest), {
        logger: function (message) {
            console.log(message);
        }
    }, end);
});

gulp.task('build', ['build:web', 'build:chrome']);

gulp.task('default', ['build']);
@@ -1,11 +1,13 @@
-var
+const
  gulp = 
@@ -23,19 +23,21 @@
 gulp');%0A
-var
+const
  webpack
@@ -66,19 +66,21 @@
 ream');%0A
-var
+const
  browser
@@ -111,19 +111,21 @@
 sync');%0A
-var
+const
  stream 
@@ -146,19 +146,21 @@
 stream;%0A
-var
+const
  ghpages
@@ -183,19 +183,21 @@
 ages');%0A
-var
+const
  path = 
@@ -213,19 +213,21 @@
 path');%0A
-var
+const
  del = r
@@ -241,19 +241,21 @@
 'del');%0A
-var
+const
  concatC
@@ -287,19 +287,21 @@
 -css');%0A
-var
+const
  gutil =
@@ -323,19 +323,21 @@
 util');%0A
-var
+const
  templat
@@ -371,11 +371,13 @@
 );%0A%0A
-var
+const
  bui

convert to const