-
Notifications
You must be signed in to change notification settings - Fork 20
/
gulpfile.js
69 lines (58 loc) · 1.61 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
var gulp = require('gulp'),
del = require('del'),
plugins = require('gulp-load-plugins')({
rename: {
'gulp-scss-lint': 'scsslint',
'gulp-clean-css': 'minifycss',
'gulp-autoprefixer' : 'prefix',
}
}),
paths = {
bootstrap: {
scripts: './node_modules/bootstrap/dist/js/bootstrap.js',
styles: './node_modules/bootstrap/'
},
scripts: './src/js/**/*.js',
styles: './src/scss/style.scss'
},
comments = ['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @link <%= pkg.homepage %>',
' * @license <%= pkg.license %>',
' */',
''].join('\n');
plugins.merge = require('merge-stream');
plugins.runSequence = require('run-sequence');
plugins.pkg = require('./package.json');
function getTask(task) {
return require('./tasks/' + task)(gulp, plugins, comments);
}
// Clean the dist directory
gulp.task('clean', function() {
return del(['dist', 'screenshots', 'failures']);
});
gulp.task('clean:css', function() {
return del(['dist/css']);
});
gulp.task('clean:js', function() {
return del(['dist/js']);
});
// Compile all scripts together
gulp.task('scripts', ['clean:js'], getTask('scripts'));
// Compile all sass files together
gulp.task('styles', ['clean:css'], getTask('styles'));
gulp.task('fonts', ['clean'], getTask('fonts'));
gulp.task('test', getTask('test'));
// Rerun the task when a file changes
gulp.task('watch', function() {
gulp.watch(paths.scripts, ['scripts']);
gulp.watch(paths.styles, ['styles']);
});
gulp.task('default', ['clean'], function () {
plugins.runSequence([
'fonts',
'styles',
'scripts',
]);
});