Last active
August 29, 2015 14:28
-
-
Save ahmadawais/48ec5b8737ae6a525b16 to your computer and use it in GitHub Desktop.
Gulp: Scripts Minification and Concatenation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Scripts: Vendors | |
* | |
* Look at src/js and concatenate those files, send them to assets/js where we then minimize the concatenated file. | |
*/ | |
gulp.task('vendorsJs', function() { | |
return gulp.src(['./assets/js/vendor/*.js', bower+'**/*.js']) | |
.pipe(concat('vendors.js')) | |
.pipe(gulp.dest('./assets/js')) | |
.pipe(rename( { | |
basename: "vendors", | |
suffix: '.min' | |
})) | |
.pipe(uglify()) | |
.pipe(gulp.dest('./assets/js/')) | |
.pipe(notify({ message: 'Vendor scripts task complete', onLast: true })); | |
}); | |
/** | |
* Scripts: Custom | |
* | |
* Look at src/js and concatenate those files, send them to assets/js where we then minimize the concatenated file. | |
*/ | |
gulp.task('scriptsJs', function() { | |
return gulp.src('./assets/js/custom/*.js') | |
.pipe(concat('custom.js')) | |
.pipe(gulp.dest('./assets/js')) | |
.pipe(rename( { | |
basename: "custom", | |
suffix: '.min' | |
})) | |
.pipe(uglify()) | |
.pipe(gulp.dest('./assets/js/')) | |
.pipe(notify({ message: 'Custom scripts task complete', onLast: true })); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment