-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
69 lines (57 loc) · 1.84 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
var gulp = require('gulp'),
browserify = require('browserify'),
fs = require('fs'),
mkdirp = require("mkdirp"),
plugins = require('gulp-load-plugins')(),
source = require('vinyl-source-stream');
gulp.task('browserify', function() {
return browserify('./app/scripts/app.js')
.bundle()
.pipe(source('main.js'))
.pipe(gulp.dest('./public/js/'));
});
gulp.task('connect', function () {
plugins.connect.server({
root: 'public',
port: 4000
});
});
gulp.task('setup', function () {
gulp.src('./app/index.html').pipe(gulp.dest('./public'));
mkdirp('./public/', function (err) {
if (err) return cb(err)
fs.writeFileSync('./public/CNAME', 'resumebuilder.rowanhogan.com');
});
});
gulp.task('images', function () {
return gulp.src('./app/images/*.**')
.pipe(gulp.dest('./public/images'));
});
gulp.task('ghpages', function() {
return gulp.src('./public/**/*')
.pipe(plugins.ghPages());
});
gulp.task('sass', function () {
gulp.src('./app/styles/*.scss')
.pipe(plugins.sass({outputStyle: 'compressed'}))
.pipe(plugins.autoprefixer())
.pipe(gulp.dest('./public/css'));
});
gulp.task('templates', function () {
return gulp.src('./app/views/**/*.html')
.pipe(plugins.angularTemplatecache({
root: 'views/',
module: 'clientApp'
}))
.pipe(gulp.dest('./public/js/'));
});
gulp.task('watch', function() {
gulp.watch('./app/**/*.html', ['templates']);
gulp.watch('./app/**/*.js', ['browserify']);
gulp.watch('./app/**/*.scss', ['sass']);
gulp.watch('./app/index.html', ['setup']);
gulp.watch('./app/images/*.**', ['images']);
});
gulp.task('build', ['setup', 'templates', 'images', 'sass', 'browserify']);
gulp.task('default', ['build', 'connect', 'watch']);
gulp.task('deploy', plugins.sequence('build', 'ghpages'));