-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
106 lines (82 loc) · 2.9 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
var gulp = require('gulp'),
runSequence = require('run-sequence'), // Temporary solution until gulp 4// https://github.com/gulpjs/gulp/issues/355
watch = require('gulp-watch');
// ---------------------------------------------------------------------
// | Helper tasks |
// ---------------------------------------------------------------------
gulp.task('copy', [
'copy:js',
'copy:css',
'copy:fonts',
'copy:custom',
'copy:html'
]);
gulp.task('copy:js', function () {
gulp.src([
"bower_components/jquery/dist/jquery.min.js",
"bower_components/bootstrap/dist/js/bootstrap.min.js",
"bower_components/angular/angular.min.js",
"bower_components/angular-animate/angular-animate.min.js",
"bower_components/angular-ui-router/release/angular-ui-router.min.js",
"node_modules/modernizr/dist/modernizr-build.min.js"
])
.pipe(gulp.dest("dist/assets/js"))
.pipe(gulp.dest("src/assets/js"));
});
gulp.task('copy:css', function () {
gulp.src([
"bower_components/bootstrap/dist/css/bootstrap.min.css",
"bower_components/bootstrap/dist/css/bootstrap-theme.min.css",
"bower_components/fontawesome/css/font-awesome.min.css",
"bower_components/animate-css/animate.min.css",
])
.pipe(gulp.dest("dist/assets/css"))
.pipe(gulp.dest("src/assets/css"));
});
gulp.task('copy:fonts', function () {
gulp.src([
'bower_components/fontawesome/fonts/**/*'
])
.pipe(gulp.dest("dist/assets/fonts"));
});
gulp.task('copy:custom', function () {
gulp.src([
"src/assets/css/custom.css"
])
.pipe(gulp.dest("dist/assets/css"));
});
gulp.task('copy:html', function () {
gulp.src([
"src/index.html"
])
.pipe(gulp.dest("dist"));
});
gulp.task('copy:app', function () {
gulp.src([
"src/app/*.js"
])
.pipe(gulp.dest("dist/app"));
});
// ---------------------------------------------------------------------
// | WATCH |
// ---------------------------------------------------------------------
gulp.task('watch',function(){
//gulp.src("src/*.html")
// .pipe(watch('src/*.html'))
// .pipe(gulp.dest("dist"));
gulp.watch("src/*.html", ['copy:html']);
gulp.watch("src/app/*.js", ['copy:app']);
gulp.watch("src/assets/css/custom.css", ['copy:custom']);
gulp.src([
"src/app/**/*"
])
.pipe(watch("src/app/**/*"))
.pipe(gulp.dest("dist/app"));
});
// ---------------------------------------------------------------------
// | Main tasks |
// ---------------------------------------------------------------------
gulp.task('build', function (done) {
runSequence('copy', done);
});
gulp.task('default', ['build']);