This repository was archived by the owner on Jul 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
114 lines (103 loc) · 2.59 KB
/
gulpfile.js
File metadata and controls
114 lines (103 loc) · 2.59 KB
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
var gulp = require('gulp');
var htmlmin = require('gulp-htmlmin');
var browserSync = require('browser-sync').create(),
reload = browserSync.reload;
var cleanCSS = require('gulp-clean-css');
var minify = require('gulp-minify');
var imagemin = require('gulp-imagemin');
var minifyInline = require('gulp-minify-inline');
var minifyInlineJSON = require('gulp-minify-inline-json');
var sitemap = require('gulp-sitemap');
var save = require('gulp-save');
gulp.task('html', function() {
return gulp.src('*.html')
.pipe(htmlmin({
collapseWhitespace: true,
removeComments: true,
quoteCharacter: "\""
}))
.pipe(minifyInline())
.pipe(minifyInlineJSON())
.pipe(gulp.dest('dist'))
.pipe(reload({
stream: true
}))
});
gulp.task('sitemap', function() {
return gulp.src(['index.html', 'img/seo.png', 'docs/prospectus.pdf'], { base: './' })
.pipe(sitemap({
siteUrl: 'https://hackchicago.io'
}))
.pipe(gulp.dest('dist'))
})
gulp.task('css', function() {
return gulp.src('css/**/*.css')
.pipe(cleanCSS({
compatibility: 'ie8'
}))
.pipe(gulp.dest('dist/css'))
.pipe(reload({
stream: true
}))
});
gulp.task('js', function() {
gulp.src('js/**/*.js')
.pipe(minify({
ext: {
src: '-debug.js',
min: '.js'
},
exclude: ['tasks'],
ignoreFiles: ['.combo.js', '-min.js']
}))
.pipe(gulp.dest('dist/js'))
.pipe(reload({
stream: true
}))
});
gulp.task('img', function() {
gulp.src('img/**/*')
//.pipe(imagemin())
.pipe(gulp.dest('dist/img'))
/*.pipe(reload({
stream: true
}))*/
});
gulp.task('fonts', function() {
gulp.src('fonts/**/*')
.pipe(gulp.dest('dist/fonts'))
.pipe(reload({
stream: true
}))
});
gulp.task('docs', function() {
gulp.src('docs/*')
.pipe(gulp.dest('dist/docs'))
.pipe(reload({
stream: true
}))
})
gulp.task('static', function() {
gulp.src('static/**/*')
.pipe(gulp.dest('dist/'))
.pipe(reload({
stream: true
}))
})
gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: "./dist/"
}
});
});
gulp.task('watch', function() {
gulp.watch('css/**/*.css', ['css']);
gulp.watch('js/**/*.js', ['js']);
gulp.watch('*.html', ['html']);
gulp.watch('img/**/*', ['img']);
gulp.watch('docs/**/*', ['docs']);
gulp.watch('fonts/**/*', ['fonts']);
});
gulp.task('default', ['browser-sync', 'html', 'js', 'css', 'img', 'fonts', 'docs', 'static', 'sitemap', 'watch']);
gulp.task('build', ['html', 'js', 'css', 'img', 'fonts', 'static', 'docs', 'sitemap']);