// including plugins
var gulp = require('gulp'),
uglify = require("gulp-uglify"),
cleanCSS = require("gulp-clean-css"),
rename = require("gulp-rename");

// task
gulp.task('minify-js', function () {
    gulp.src(['js/*.js', '!js/*.min.js']) // path to your files
    .pipe(uglify())
    .pipe(rename({
        suffix: '.min'
    }))
    .pipe(gulp.dest('js/'));
});

// task
gulp.task('minify-css', function () {
    gulp.src(['css/*.css', '!css/*.min.css']) // path to your files
    .pipe(cleanCSS({debug: true}, function(details) {
        console.log("Original: " + details.name + ': ' + details.stats.originalSize);
        console.log("Minify: " +details.name + ': ' + details.stats.minifiedSize);
    }))
    .pipe(rename({
        suffix: '.min'
    }))
    .pipe(gulp.dest('css/'));
});