-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.babel.js
75 lines (45 loc) · 1.88 KB
/
gulpfile.babel.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
/*
Generated on 2017-09-11 using generator-surprise 1.0.5
*/
/* Common paths */
// Enter the proxy url running your local php server
const local_proxy = 'base-front-end.local';
import { HTTP_PATH, SCSS_DIR, JS_DIR } from './gulp-tasks/paths';
import gulp from 'gulp';
import browserSync from 'browser-sync';
import styles from './gulp-tasks/styles';
import scripts from './gulp-tasks/scripts';
import { clean, cleanScripts, cleanStyles, cleanApp } from './gulp-tasks/clean';
import { distStyles, distScripts, distApp } from './gulp-tasks/dist';
import { wireMockups, wireStyleguide } from './gulp-tasks/bower';
browserSync.create();
// Process our sass
gulp.task('styles', ['clean:styles'], styles);
// Process our scripts
gulp.task('scripts', ['clean:scripts'], scripts);
// Delete everything in the dist directory
gulp.task('clean', clean);
// Delete all JS scripts in dist directory
gulp.task('clean:scripts', cleanScripts);
// Delete all CSS in dist directory
gulp.task('clean:styles', cleanStyles);
// Rev styles and scripts.
gulp.task('dist:scripts', ['scripts'], distScripts);
gulp.task('dist:styles', ['styles'], distStyles);
gulp.task('dist', ['dist:scripts', 'dist:styles'], function() { return; });
// Wire bower components up to our mockup and styleguide templates.
gulp.task('wire:mockups', wireMockups);
gulp.task('wire:styleguide', wireStyleguide);
// Watch for file changes.
gulp.task('watch', function() {
// Proxy Browser Sync through local url
browserSync.init({ proxy: local_proxy, notify: false });
// Watch .scss files
gulp.watch(SCSS_DIR + '/**/*.scss', ['dist:styles']);
// Watch .js files
gulp.watch(JS_DIR + '/**/*.js', ['dist:scripts']);
// Watch mockups
gulp.watch([HTTP_PATH+'/mockups/**/*.html', HTTP_PATH+'/mockups/**/*.php']).on('change', browserSync.reload);
});
// Our default gulp tasks.
gulp.task('default', ['dist', 'watch'], function(){});