This repository has been archived by the owner on Aug 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·69 lines (61 loc) · 1.59 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
var gulp = require('gulp'),
gutil = require('gulp-util'),
sass = require('gulp-sass'),
connect = require('gulp-connect'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
order = require('gulp-order');
var jsSources = ['js/*.js'],
sassSources = ['sass/*.scss'],
htmlSources = ['**/*.html'],
outputCSSDir = 'css',
outputJSDir = 'js',
outputDir = 'dist';
gulp.task('sass', function() {
gulp.src(sassSources)
.pipe(sass({outputStyle: 'expanded'}))
.on('error', gutil.log)
.pipe(gulp.dest(outputCSSDir))
.pipe(connect.reload())
});
gulp.task('js', function() {
gulp
.src(jsSources)
.pipe(order([
'js/jquery.min.js',
'js/jquery.easing.1.3.js',
'js/bootstrap.min.js',
'js/jquery.waypoints.min.js',
'js/sticky.js',
'js/jquery.stellar.min.js',
'js/hoverIntent.js',
'js/superfish.js',
'js/jquery.magnific-popup.min.js',
'js/magnific-popup-options.js',
'js/google_map.js',
'js/main.js'
], {base: './'}))
.pipe(concat('scripts.js'))
.pipe(gulp.dest(outputDir))
.pipe(uglify({mangle: false}))
.pipe(rename('scripts.min.js'))
.pipe(gulp.dest(outputDir))
.pipe(connect.reload())
});
gulp.task('watch', function() {
gulp.watch(jsSources, ['js']);
gulp.watch(sassSources, ['sass']);
gulp.watch(htmlSources, ['html']);
});
gulp.task('connect', function() {
connect.server({
root: '.',
livereload: true
})
});
gulp.task('html', function() {
gulp.src(htmlSources)
.pipe(connect.reload())
});
gulp.task('default', ['html', 'js', 'sass', 'connect', 'watch']);