'use strict';

var cache = require('gulp-cached');

// Copies "anything else" from FE src to target, and webapp - this includes LESS files (they're needed at runtime),
// and JS files that aren't transpiled, as well as any other images etc.
module.exports = function (gulp, paths) {
    return function() {
        gulp.src(
            [
                // we want JS here, because we need to get all the JS that isn't under 'bitbucket'
                paths.FRONTEND_SRC + '/**/*.*',
                // excludes JS under 'bitbucket', but not Bower & lib
                '!' + paths.FRONTEND_SRC + paths.JS_GLOB
            ],
            {
                base: paths.FRONTEND_SRC
            }
        )
            .pipe(cache('bbs-assets'))
            .pipe(gulp.dest(paths.FRONTEND_TARGET));
    }
};