Created
May 5, 2016 03:17
-
-
Save hunvreus/5b34b0b3b25e10b564fa0656681acc64 to your computer and use it in GitHub Desktop.
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
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
var minify = require('gulp-minify-css'); | |
var assets = { | |
'js': [ | |
"bower_components/jquery/dist/jquery.js", | |
"bower_components/highlightjs/highlight.pack.js", | |
"bower_components/jquery-timeago/jquery.timeago.js", | |
"_js/*.js" | |
], | |
'css': [ "_scss/**/*.{scss,sass}" ] | |
}; | |
// Prepares the JS file | |
gulp.task('js', function() { | |
gulp.src(assets.js) | |
.pipe(concat('scripts.js')) | |
.pipe(uglify()) | |
.pipe(gulp.dest('assets')); | |
}); | |
// Prepares the CSS file | |
gulp.task('css', function() { | |
gulp.src(assets.css) | |
.pipe(sass({ includePaths: require('node-bourbon').includePaths })) | |
.pipe(concat('styles.css')) | |
.pipe(minify({keepBreaks:true})) | |
.pipe(gulp.dest('_includes')); | |
}); | |
// Prepares JS & CSS assets | |
gulp.task('default', ['css', 'js']); | |
// Prepares assets & watch for changes | |
gulp.task('development', ['css', 'js'], function(callback) { | |
gulp.watch(assets.js, ['js']); | |
gulp.watch(assets.css, ['css']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment