-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
57 lines (50 loc) · 1.43 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
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var minifyCss = require('gulp-minify-css');
var minifyHtml = require('gulp-minify-html');
var sass = require('gulp-sass');
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var ghPages = require('gulp-gh-pages');
gulp.task('default', ['build'], function() {
});
gulp.task('sass', function() {
return gulp.src('./app/styles/*.scss')
.pipe(sass({
includePaths: ['./app/vendor/', './app/styles/']
}))
.pipe(minifyCss({}))
.pipe(gulp.dest('./dist/css/'));
});
gulp.task('scripts', function() {
var b = browserify({
entries: './app/js/index.js',
debug: true
});
return b.bundle()
.pipe(source('bundle.js'))
.pipe(buffer())
.pipe(uglify())
.pipe(gulp.dest('./dist/js'));
});
gulp.task('watch', ['build'], function() {
gulp.watch(['./app/**/*.html', './app/styles/**/*.scss', './app/**/*.js'], ['build']);
});
gulp.task('images', function() {
gulp.src('./app/images/**/*')
.pipe(gulp.dest('./dist/images'))
});
gulp.task('cname', function() {
gulp.src('./app/CNAME')
.pipe(gulp.dest('./dist/'))
});
gulp.task('build', ['cname', 'scripts', 'sass', 'images'], function() {
gulp.src('./app/**/*.html')
.pipe(minifyHtml({}))
.pipe(gulp.dest('./dist/'))
});
gulp.task('deploy', function() {
return gulp.src('./dist/**/*')
.pipe(ghPages());
});