-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
65 lines (54 loc) · 1.29 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
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import browserSync from 'browser-sync'
import beep from 'beepbeep'
/**
* Auto load all gulp plugins and set the scope
*/
const $ = gulpLoadPlugins({pattern: ['gulp-*', 'gulp.*', 'run-sequence', 'del'], scope: ['devDependencies']});
/**
* Create dev server
*/
const server = browserSync.create()
require('./gulp/bridge.js')(gulp, [
'clean',
'fonts',
'html',
'images',
'server',
'sprite',
'styles',
'watch',
'webpack'
], $, server)
/**
* Default Task
*/
gulp.task('default', done => {
$.runSequence('server', 'watch', () => {
$.util.log($.util.colors.green.bold('START SERVER'))
done()
})
})
//gulp.task('default', done => runSequence('server', 'watch', done))
/**
* Dist folder build without cleaning.
*
* Note: Webpack is handled by the dev middleware. We don't need to run the task now.
*/
gulp.task('build', done => {
$.runSequence('sprite', ['styles', 'images', 'html', 'fonts'], () => {
$.util.log($.util.colors.green.bold('ASSET BUILD COMPLETE'))
done()
})
})
/**
* Clean dist folder build
*/
gulp.task('dist', done => {
$.runSequence('clean', 'build', 'webpack', () => {
$.util.log($.util.colors.green.bold('DISTRIBUTION BUILD COMPLETE'));
beep(2)
done()
})
})