-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
85 lines (70 loc) · 2.05 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/************************************
*
* FILE: gulpfile.js
* AUTHOR: Jake Breindel
* DATE: 10-30-15
*
* DESCRIPTION:
*
* Gulpfile for compiling and
* deploying dependencies.
*
************************************/
'use strict';
// dependencies
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var bower = require('gulp-bower');
var streamqueue = require('streamqueue');
// directories
var SASS_DIR = './priv/static/sass/';
var JS_DIR = './priv/static/js/';
var CSS_DIR = './priv/static/css/';
var FONTS_DIR = './priv/static/fonts/';
var BOWER_DIR = './priv/static/bower_components/';
// lib dirs
var FOUND_SASS_DIR = BOWER_DIR + 'foundation/scss/';
var FONT_AWE_SASS_DIR = BOWER_DIR + 'font-awesome/scss/';
// bower install
gulp.task('bower', function() {
// run bower
return bower();
});
// css files
gulp.task('css', ['bower'], function() {
// concatenate the streams
return gulp.src(SASS_DIR + '*.scss')
.pipe(sass({
includePaths: [FOUND_SASS_DIR, FONT_AWE_SASS_DIR]
}))
.pipe(concat('app.css'))
.pipe(gulp.dest(CSS_DIR));
});
// necessary library files
gulp.task('jsLibs', ['bower'], function() {
// copy modernizer and libs
return gulp.src(BOWER_DIR + 'foundation/js/vendor/modernizr.js')
.pipe(gulp.dest(JS_DIR));
});
// js files
gulp.task('js', ['bower'], function() {
// javascript libs
return streamqueue({ objectMode: true },
gulp.src(BOWER_DIR + 'jquery/dist/jquery.js'),
gulp.src(BOWER_DIR + 'fastclick/lib/fastclick.js'),
gulp.src(BOWER_DIR + 'foundation/js/foundation.js'),
gulp.src(BOWER_DIR + 'watch/src/watch.js'),
gulp.src(BOWER_DIR + 'underscore/underscore.js')
)
.pipe(concat('app.js'))
.pipe(gulp.dest(JS_DIR));
});
// font files
gulp.task('font', ['bower'], function() {
// copy font files
return gulp.src(BOWER_DIR + 'font-awesome/fonts/*')
.pipe(gulp.dest(FONTS_DIR));
});
// default gulp task
gulp.task('default', ['css', 'jsLibs', 'js', 'font']);