-
Notifications
You must be signed in to change notification settings - Fork 237
/
Copy pathgulpfile.js
82 lines (71 loc) · 1.88 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
var gulp = require('gulp'),
runSequence = require('run-sequence'),
rimraf = require('rimraf').sync,
requireDir = require('require-dir'),
browser = require('browser-sync'),
config = require('./gulp/config');
requireDir('./gulp');
/**
* Gulp task default.
* Calls build:all.
*/
gulp.task('default', ['serve', 'watch']);
/**
* Gulp task build:all.
* Calls build:foundation and build:standalone.
*/
gulp.task('build:all', function(cb) {
runSequence('build:foundation', 'build:standalone', cb);
});
/**
* Gulp task build:foundation.
* Calls js:foundation and css:foundation.
*/
gulp.task('build:foundation', ['js:foundation', 'css:foundation']);
/**
* Gulp task build:standalone.
* Calls js:standalone and css:standalone.
*/
gulp.task('build:standalone', ['js:standalone', 'css:standalone']);
/**
* Gulp task dist.
* Copies the built files into the dist folder.
*/
gulp.task('dist', ['js:min', 'css:min'], function() {
// uninified files
gulp.src([config.buildPath + 'assets/*'])
.pipe(gulp.dest(config.destPath));
});
/**
* Gulp task watch.
* Watch files for changes and reloads the browser.
*/
gulp.task('watch', function() {
gulp.watch('./js/**/*', [[['js:foundation'], 'js:standalone'], browser.reload]);
gulp.watch('./scss/**/*', [[['css:foundation'], 'css:standalone'], browser.reload]);
gulp.watch('./test/visual/*.html', [browser.reload]);
});
/**
* Gulp task serve.
* Starts a BrowerSync instance.
*/
gulp.task('serve', ['build:all'], function() {
browser.init({
server: {
baseDir: './test/visual',
routes: {
"/assets": "_build/assets",
"/jquery": "node_modules/jquery",
"/foundation-sites": "node_modules/foundation-sites",
"/what-input": "node_modules/what-input"
}
}
});
});
/**
* Gulp task clean.
* Deletes the build folder.
*/
gulp.task('clean', function () {
rimraf(config.buildPath);
});