-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
129 lines (113 loc) · 3.96 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
var gulp = require('gulp');
var babel = require('gulp-babel');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
//var bower = require('gulp-bower');
var minifyhtml = require('gulp-minify-html');
var minifyinline = require('gulp-minify-inline');
// Dev build
gulp.task('transpile', function() {
return gulp.src(['src/**/*.es6'])
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest('staging'));
});
// gulp.task('copy-package-json', function() {
// return gulp.src('package.json')
// .pipe(gulp.dest('staging'));
// });
// gulp.task('copy-vendor-libs', function() {
// return gulp.src(['src/public/bower_components/**/*.*', 'src/public/vendor/**/*.*'])
// .pipe(gulp.dest('staging/public/vendor'));
// });
// gulp.task('copy-vendor-libs', function() {
// return gulp.src('src/public/vendor/**/*.*')
// .pipe(gulp.dest('staging/public/vendor'));
// });
// gulp.task('copy-bower-json', function() {
// return gulp.src('src/public/bower.json')
// .pipe(gulp.dest('staging/public'));
// });
gulp.task('copy-html', function() {
return gulp.src(['src/public/**/*.html', '!src/public/{bower_components,bower_components/**}', '!src/public/{vendor,vendor/**}'])
.pipe(gulp.dest('staging/public'));
});
gulp.task('copy-css', function() {
return gulp.src('src/public/**/*.css')
.pipe(gulp.dest('staging/public'));
});
// gulp.task('copy-images', function() {
// return gulp.src('src/public/images/**/*.*')
// .pipe(gulp.dest('staging/public/images'));
// });
gulp.task('copy-images', function() {
return gulp.src(['src/public/**/*.png', 'src/public/**/*.jpg', 'src/public/**/*.gif', 'src/public/**/*.svg'])
.pipe(gulp.dest('staging/public'));
});
gulp.task('copy-js', function() {
return gulp.src('src/**/*.js')
.pipe(gulp.dest('staging'));
});
gulp.task('copy-json', function() {
return gulp.src('src/public/**/*.json')
.pipe(gulp.dest('staging/public'));
});
gulp.task('copy-xml', function() {
return gulp.src('src/public/**/*.xml')
.pipe(gulp.dest('staging/public'));
});
gulp.task('watch', function() {
gulp.watch('src/**/*.es6', ['transpile']);
gulp.watch('src/public/**/*.html', ['copy-html']);
gulp.watch('src/public/**/*.css', ['copy-css']);
gulp.watch('src/public/images/**/*.*', ['copy-images']);
gulp.watch('src/public/js/**/*.js', ['copy-js']);
gulp.watch('src/public/**/*.json', ['copy-json']);
});
//gulp.task('copycss', function() {
// return gulp.src('src/**/*.css')
// .pipe(gulp.dest('dist'));
//});
// gulp.task('copyimages', function() {
// return gulp.src('src/images/**/*.*')
// .pipe(gulp.dest('dist/images'));
// });
//
// gulp.task('copylibdist', function() {
// return gulp.src('src/lib/*.*')
// .pipe(gulp.dest('dist/lib'));
// });
//
// gulp.task('bower', function() {
// return bower()
// .pipe(gulp.dest('dist/lib'));
// });
//
// gulp.task('watch', function() {
// gulp.watch('src/**/*.ts', ['compilets']);
// gulp.watch('src/**/*.html', ['copyhtml']);
// gulp.watch('src/**/*.css', ['copycss']);
// gulp.watch('src/images/**/*.*', ['copyimages']);
// });
//
// // Prod build
// gulp.task('bowerprod', function() {
// return bower()
// .pipe(gulp.dest('prod/lib'));
// });
//
// gulp.task('vulcanize', function() {
// return gulp.src('dist/index.html')
// .pipe(vulcanize({
// excludes: [],
// stripExcludes: false,
// inlineScripts: true
// }))
// .pipe(minifyinline())
// .pipe(minifyhtml())
// .pipe(gulp.dest('prod'));
// });
gulp.task('default', ['transpile', 'copy-html', 'copy-css', 'copy-images', 'copy-js', 'copy-json', 'copy-xml', 'watch']);
//gulp.task('default', ['compilets', 'copyhtml', 'copyimages', 'copycss', 'copylibdist', 'bower', 'watch']);
//gulp.task('prod', ['bowerprod', 'copylibdist', 'vulcanize']);