This repository has been archived by the owner on Nov 20, 2021. It is now read-only.
forked from leandrowd/react-responsive-carousel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
85 lines (69 loc) · 1.95 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
83
84
85
var configs = require('./tasks/configs');
var gulp = require('gulp');
var browserifyTask = require('./tasks/browserify');
var cssTask = require('./tasks/css');
var jestTask = require('./tasks/jest');
var connectTask = require('./tasks/connect');
var copyTask = require('./tasks/copy');
var ghPagesTask = require('./tasks/gh-pages');
gulp.task('webserver', function() {
connectTask();
});
gulp.task('test', function(callback) {
return jestTask(callback);
});
gulp.task('scripts', function() {
return browserifyTask({
environment: 'development'
}).vendor();
})
gulp.task('scripts:production', function() {
return browserifyTask({
environment: 'production'
}).vendor();
})
gulp.task('styles', function() {
return cssTask({
environment: 'development'
});
})
gulp.task('styles:production', function() {
return cssTask({
environment: 'production'
});
})
gulp.task('styles:package', function() {
return cssTask({
environment: 'package'
});
})
gulp.task('copy', function() {
return copyTask({
environment: 'development'
});
})
gulp.task('copy:package', function() {
return copyTask({
environment: 'package'
});
})
gulp.task('copy:production', function() {
return copyTask({
environment: 'production'
});
})
gulp.task('prepublish', ['test', 'scripts:production', 'styles:production', 'copy:production'])
gulp.task('publish', function(done) {
return ghPagesTask(done);
})
// Development workflow
gulp.task('default', ['scripts', 'test', 'styles', 'copy', 'webserver'], function() {
gulp.watch(configs.paths.source + "/**/*.js", ['scripts', 'test'])
.on('change', function(event) {
console.log('Scripts watcher trigger: ' + event.path + ' was ' + event.type + ', running tasks...');
});
gulp.watch(configs.paths.source + "/**/*.scss", ['styles'])
.on('change', function(event) {
console.log('Styles watcher trigger: ' + event.path + ' was ' + event.type + ', running tasks...');
});
});