Skip to content

Instantly share code, notes, and snippets.

@LoyEgor
Last active April 23, 2017 04:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LoyEgor/322b583ce76abf92ec1701426eca48ee to your computer and use it in GitHub Desktop.
Save LoyEgor/322b583ce76abf92ec1701426eca48ee to your computer and use it in GitHub Desktop.
compress js
// install
// npm i gulp-concat gulp-uglify
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
// concat and clean js
gulp.task('compress:js', function () {
var jsjq = './app/js/jquery.min.js';
var jscore = './app/js/core.js';
var jsplug = './app/js/plugins.js';
var jsscript = './app/js/scripts.js';
return gulp.src([jsjq, jscore, jsplug, jsscript])
.pipe(concat('scripts.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist/js'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment