-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
57 lines (51 loc) · 1.7 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
var gulp = require('gulp'),
errorHandler = require('./gulp/tasks/errorHandler'),
plugins = {},
config = require('./gulp/config');
// sass/css plugins
plugins.sass = require('gulp-ruby-sass');
plugins.sourcemaps = require('gulp-sourcemaps');
plugins.autoprefixer = require('gulp-autoprefixer');
plugins.minifycss = require('gulp-minify-css');
plugins.pixrem = require('gulp-pixrem');
// js plugins
plugins.browserify = require('gulp-browserify');
plugins.babelify = require('babelify');
plugins.source = require('vinyl-source-stream');
plugins.uglify = require('gulp-uglify');
// misc plugins
plugins.filter = require('gulp-filter');
plugins.debug = require('gulp-debug');
plugins.concat = require('gulp-concat');
plugins.rename = require('gulp-rename');
plugins.notify = require('gulp-notify');
plugins.del = require('del');
plugins.browserSync = require('browser-sync');
plugins.reload = plugins.browserSync.reload;
// allows us to grab task functions from folder
function getTask(task) {
return require('./gulp/tasks/' + task)(gulp, plugins, config, errorHandler);
}
// tasks
if (config.sass.isEnabled) {
gulp.task('styles', getTask('styles'));
};
if (config.js.isEnabled) {
gulp.task('scripts', getTask('scripts'));
};
if (config.browserSync.isEnabled) {
gulp.task('browser-sync', getTask('browserSync'));
};
if (config.watch.isEnabled) {
gulp.task('watch', getTask('watch'));
};
gulp.task('no-fn', function(){ return false; });
// let's goooooo!
gulp.task('default', function(){
gulp.start(
(config.sass.isEnabled ? 'styles' : 'no-fn'),
(config.js.isEnabled ? 'scripts' : 'no-fn'),
(config.browserSync.isEnabled ? 'browser-sync' : 'no-fn'),
(config.watch.isEnabled ? 'watch' : 'no-fn')
);
});