-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
89 lines (81 loc) · 2.37 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
var gulp = require('gulp');
var cssnano = require('gulp-cssnano');
var htmlreplace = require('gulp-html-replace');
var concatCss = require('gulp-concat-css');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var open = require("gulp-open");
var cssFiles = [
'./css/bootstrap/bootstrap.min.css',
'./css/animations/animate.min.css',
'./css/swipebox/swipebox.min.css',
'./css/swipebox/swipebox.min.css',
'./css/font-awesome/font-awesome.min.css',
'./css/owl-carousel/owl.carousel.css',
'./css/owl-carousel/owl.theme.css',
'./css/reset.css',
'./css/style.css',
'./css/mobile.css',
'./css/skin/color.css'
];
var jsFiles = [
'./js/countdown.js',
'./js/jquery/jquery-2.1.4.min.js',
'./js/bootstrap/bootstrap.min.js',
'./js/bootstrap/jquery.bootstrap.wizard.min.js',
'./js/owl-carousel/owl.carousel.min.js',
'./js/stellar/jquery.stellar.min.js',
'./js/animations/wow.min.js',
'./js/waypoints.min.js',
'./js/isotope.pkgd.min.js',
'./js/classie.js',
'./js/jquery.easing.min.js',
'./js/jquery.counterup.min.js',
'./js/smoothscroll.js',
'./js/swipebox/jquery.swipebox.min.js',
'./js/theme.js',
'./js/app.js'
];
gulp.task('bundleCSS', function() {
return gulp.src(['css/*/*.css', 'css/*.css'])
.pipe(concatCss('bundle.min.css'))
.pipe(cssnano())
.pipe(gulp.dest('css'));
});
gulp.task('bundleJS', function() {
return gulp.src(['js/*/*.js', 'js/*.js'])
.pipe(concat('bundle.min.js'))
.pipe(uglify())
.pipe(gulp.dest('js'));
});
gulp.task('prodReplace', function() {
return gulp.src('./index.html')
.pipe(htmlreplace({
'css': './css/bundle.min.css',
'js': './js/bundle.min.js'
},{
keepUnassigned: true,
keepBlockTags: true,
resolvePaths: true
}))
.pipe(gulp.dest('./'));
});
gulp.task('devReplace', function() {
return gulp.src('./index.html')
.pipe(htmlreplace({
'css': cssFiles,
'js': jsFiles
},{
keepUnassigned: true,
keepBlockTags: true,
resolvePaths: true
}))
.pipe(gulp.dest('./'));
});
gulp.task("open", function() {
return gulp.src("./index.html")
.pipe(open());
});
gulp.task('prod', ['bundleCSS', 'prodReplace']);
gulp.task('dev', ['devReplace']);
gulp.task("start", ["open"]);