Gulp default task unable to compress after copy

By uioporqwerty

At first I thought this was related to dependency of tasks so I went with run-sequence and even tried defining dependencies within tasks themselves. But I cannot get the compress task to run after copy. Or, even if it says it did finish the compress task, the compression only works if I run compress in the task runner inside visual studio by itself. What else can I try to get it to compress after copy?

/// <binding BeforeBuild='default' />
/*
This file is the main entry point for defining Gulp tasks and using Gulp plugins.
Click here to learn more. https://go.microsoft.com/fwlink/?LinkId=518007
*/
var gulp = require("gulp");
var debug = require("gulp-debug");
var del = require("del");
var uglify = require("gulp-uglify");
var pump = require("pump");
var runSequence = require("run-sequence");
var paths = {
    bower: "./bower_components/",
    lib: "./Lib/"
};
var modules = {
    "store-js": ["store-js/dist/store.legacy.js"],
    "bootstrap-select": [
        "bootstrap-select/dist/css/bootstrap-select.css",
        "bootstrap-select/dist/js/bootstrap-select.js",
        "bootstrap-select/dist/js/i18n/*.min.js"
    ]
}
gulp.task("default", function (cb) {
    runSequence("clean", ["copy", "compress"], cb);
});
gulp.task("clean",
    function () {
        return del.sync(["Lib/**", "!Lib", "!Lib/ReadMe.md"]);
    });
gulp.task("compress",
    function (cb) {
        pump([
            gulp.src(paths.lib + "**/*.js"),
            uglify(),
            gulp.dest(paths.lib)
        ], cb);
    });
gulp.task("copy",
    function (cb) {
        prefixPathToModules();
        copyModules();
        cb();
    });
function prefixPathToModules() {
    for (var moduleIndex in modules) {
        for (var fileIndex in modules[moduleIndex]) {
            modules[moduleIndex][fileIndex] = paths.bower + modules[moduleIndex][fileIndex];
        }
    }
}
function copyModules() {
    for (var files in modules) {
        gulp.src(modules[files], { base: paths.bower })
            .pipe(gulp.dest(paths.lib));
    }
}

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273