<commit_before>var gulp = require('gulp');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var babelify = require('babelify');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var connect = require('gulp-connect');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var envify = require('envify');
var minifyCss = require('gulp-minify-css');
var gulpHtmlVersion = require('gulp-html-version');
var runSequence = require('run-sequence');

gulp.task('env-dev', function() {
    process.env.NODE_ENV = 'development';
});

gulp.task('env-prod', function() {
    process.env.NODE_ENV = 'production';
});

gulp.task('copy', function() {
    return gulp.src('src/*.html')
        .pipe(gulpHtmlVersion())
        .pipe(gulp.dest('www/'));
});

gulp.task('fonts', function() {
    return gulp.src('src/scss/fonts/*')
        .pipe(gulp.dest('www/fonts/'));
});

gulp.task('assets', function() {
    return gulp.src(['src/*.ico', 'src/*.png', 'src/manifest.json', 'src/google-services.json', 'src/GoogleService-Info.plist', 'src/*.svg', './node_modules/framework7/dist/js/framework7.min.js.map'])
        .pipe(gulp.dest('www/'));
});

gulp.task('images', function() {
    return gulp.src(['src/img/*', 'src/scss/img/*', 'src/scss/img/**/*'])
        .pipe(gulp.dest('www/img/'));
});

gulp.task('sass', function() {
    var paths = [
        './node_modules/framework7/dist/css/framework7.ios.css',
        './node_modules/Framework7-3D-Panels/dist/framework7.3dpanels.css',
        './node_modules/react-image-crop/dist/ReactCrop.css',
        './node_modules/react-joyride/lib/styles/react-joyride-compiled.css',
        './node_modules/react-infinite-calendar/styles.css',
        './src/scss/pages/*.scss',
        './src/scss/*.scss'
    ];

    return gulp.src(paths)
        .pipe(sass.sync().on('error', sass.logError))
        .pipe(concat('bundle.css'))
        .pipe(gulp.dest('./www/'))
        .pipe(connect.reload());
});

gulp.task('build-vendor-js', function() {
    var paths = [
        './node_modules/framework7/dist/js/framework7.min.js',
        './node_modules/Framework7-3D-Panels/dist/framework7.3dpanels.min.js',
        './src/js/vendor/hello.js',
        './src/js/vendor/socket.io.min.js',
        './src/js/vendor/manup.min.js'
    ];
    return gulp.src(paths)
        .pipe(concat('vendor.js'))
        .pipe(gulp.dest('./www'))
        .pipe(connect.reload());
});

gulp.task('build-hello-js', function() {
    return gulp.src('./src/js/vendor/hello.js')
        .pipe(gulp.dest('www/'));
});

gulp.task('build-js', function() {
    return browserify('./src/js/index.js')
        .transform(babelify)
        .transform(envify)
        .bundle()
        .pipe(source('bundle.js'))
        .pipe(gulp.dest('./www'))
        .pipe(connect.reload());
});

gulp.task('build-service-worker', function() {
    return browserify('./src/js/firebase-messaging-sw.js')
        .transform(babelify)
        .bundle()
        .pipe(source('firebase-messaging-sw.js'))
        .pipe(gulp.dest('./www'))
        .pipe(connect.reload());
});

gulp.task('minify-js', ['build'], function() {
    return gulp.src('www/bundle.js')
        .pipe(uglify())
        .pipe(gulp.dest('./www'));
});

gulp.task('minify-css', ['sass'], function() {
    return gulp.src('www/bundle.css')
        .pipe(minifyCss())
        .pipe(gulp.dest('./www'));
});

// Rerun tasks whenever a file changes.
gulp.task('watch', ['build'], function() {
    gulp.watch('./src/scss/**/*', ['sass']);
    gulp.watch('./src/js/**/*', ['build-js']);
});

// Development
gulp.task('serve', function() {
    connect.server({
        root      : 'www',
        host      : '*',
        port      : 80,
        livereload: true
    });
});

gulp.task('build', ['copy', 'fonts', 'assets', 'images', 'sass', 'build-js', 'build-service-worker', 'build-vendor-js', 'build-hello-js']);
gulp.task('release', ['env-prod'], function() {
    runSequence('minify-js', 'minify-css');
});
gulp.task('dev', ['env-dev'], function() {
    runSequence('build', 'serve', 'watch');
});<commit_msg>QS-1445: Make gulp dev and release faster<commit_after>var gulp = require('gulp');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var babelify = require('babelify');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var connect = require('gulp-connect');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var envify = require('envify');
var minifyCss = require('gulp-minify-css');
var gulpHtmlVersion = require('gulp-html-version');
var runSequence = require('run-sequence');

gulp.task('env-dev', function() {
    process.env.NODE_ENV = 'development';
});

gulp.task('env-prod', function() {
    process.env.NODE_ENV = 'production';
});

gulp.task('copy', function() {
    return gulp.src('src/*.html')
        .pipe(gulpHtmlVersion())
        .pipe(gulp.dest('www/'));
});

gulp.task('fonts', function() {
    return gulp.src('src/scss/fonts/*')
        .pipe(gulp.dest('www/fonts/'));
});

gulp.task('assets', function() {
    return gulp.src(['src/*.ico', 'src/*.png', 'src/manifest.json', 'src/google-services.json', 'src/GoogleService-Info.plist', 'src/*.svg', './node_modules/framework7/dist/js/framework7.min.js.map'])
        .pipe(gulp.dest('www/'));
});

gulp.task('images', function() {
    return gulp.src(['src/img/*', 'src/scss/img/*', 'src/scss/img/**/*'])
        .pipe(gulp.dest('www/img/'));
});

gulp.task('sass', function() {
    var paths = [
        './node_modules/framework7/dist/css/framework7.ios.css',
        './node_modules/Framework7-3D-Panels/dist/framework7.3dpanels.css',
        './node_modules/react-image-crop/dist/ReactCrop.css',
        './node_modules/react-joyride/lib/styles/react-joyride-compiled.css',
        './node_modules/react-infinite-calendar/styles.css',
        './src/scss/pages/*.scss',
        './src/scss/*.scss'
    ];

    return gulp.src(paths)
        .pipe(sass.sync().on('error', sass.logError))
        .pipe(concat('bundle.css'))
        .pipe(gulp.dest('./www/'))
        .pipe(connect.reload());
});

gulp.task('build-vendor-js', function() {
    var paths = [
        './node_modules/framework7/dist/js/framework7.min.js',
        './node_modules/Framework7-3D-Panels/dist/framework7.3dpanels.min.js',
        './src/js/vendor/hello.js',
        './src/js/vendor/socket.io.min.js',
        './src/js/vendor/manup.min.js'
    ];
    return gulp.src(paths)
        .pipe(concat('vendor.js'))
        .pipe(gulp.dest('./www'))
        .pipe(connect.reload());
});

gulp.task('build-hello-js', function() {
    return gulp.src('./src/js/vendor/hello.js')
        .pipe(gulp.dest('www/'));
});

gulp.task('build-js', function() {
    return browserify('./src/js/index.js')
        .transform(babelify)
        .transform(envify)
        .bundle()
        .pipe(source('bundle.js'))
        .pipe(gulp.dest('./www'))
        .pipe(connect.reload());
});

gulp.task('build-service-worker', function() {
    return browserify('./src/js/firebase-messaging-sw.js')
        .transform(babelify)
        .bundle()
        .pipe(source('firebase-messaging-sw.js'))
        .pipe(gulp.dest('./www'))
        .pipe(connect.reload());
});

gulp.task('minify-js', ['build'], function() {
    return gulp.src('www/bundle.js')
        .pipe(uglify())
        .pipe(gulp.dest('./www'));
});

gulp.task('minify-css', ['sass'], function() {
    return gulp.src('www/bundle.css')
        .pipe(minifyCss())
        .pipe(gulp.dest('./www'));
});

// Rerun tasks whenever a file changes.
gulp.task('watch', ['build'], function() {
    gulp.watch('./src/scss/**/*', ['sass']);
    gulp.watch('./src/js/**/*', ['build-js']);
});

// Development
gulp.task('serve', function() {
    connect.server({
        root      : 'www',
        host      : '*',
        port      : 80,
        livereload: true
    });
});

gulp.task('build', ['copy', 'fonts', 'assets', 'images', 'sass', 'build-js', 'build-service-worker', 'build-vendor-js', 'build-hello-js']);
gulp.task('minify', ['minify-js', 'minify-css']);
gulp.task('release', ['env-prod'], function() {
    runSequence('minify');
});
gulp.task('build-dev', ['build', 'serve', 'watch']);
gulp.task('dev', ['env-dev'], function() {
    runSequence('build-dev');
});
{'fraction_non_alphanumeric': 0.23183556405353728, 'fraction_numerical': 0.004302103250478011, 'mean_word_length': 3.0119846596356665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 28, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '285284', 'n_tokens_mistral': 2961, 'n_tokens_neox': 2947, 'n_words': 392}