-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgulpfile.js
62 lines (56 loc) · 1.75 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
const
gulp = require('gulp')
plumber = require('gulp-plumber')
pug = require('gulp-pug')
sass = require('gulp-sass')
autoprefixer = require('gulp-autoprefixer')
uglify = require('gulp-uglify')
rename = require('gulp-rename')
webserver = require('gulp-webserver')
gulp.task('pug', function(){
return gulp.src('./src/views/*.pug')
.pipe(plumber())
.pipe(pug())
.pipe(gulp.dest('./'))
});
gulp.task('sass', function(){
return gulp.src('./src/sass/master.sass')
.pipe(plumber())
.pipe(sass({outputStyle: 'compressed'}))
.pipe(autoprefixer({
browsers: [
"Android 2.3",
"Android >= 4",
"Chrome >= 20",
"Firefox >= 24",
"Explorer >= 7",
"iOS >= 6",
"Opera >= 12",
"Safari >= 6"
],
cascade: false,
}))
.pipe(gulp.dest('./dist/css'))
});
gulp.task('js', function(){
return gulp.src('./src/js/master.js')
.pipe(plumber())
.pipe(uglify())
.pipe(gulp.dest('./dist/js'))
});
gulp.task('bootstrap', function(){
return gulp.src('./src/bootstrap/override.scss')
.pipe(plumber())
.pipe(sass({outputStyle: 'compressed'}))
.pipe(rename('bootstrap.css'))
.pipe(gulp.dest('./dist/css'))
});
gulp.task('run', function(){
gulp.src('./')
.pipe(webserver({
open: true
}))
})
gulp.task('default', ['pug', 'sass', 'js', 'bootstrap', 'run'], function(){
console.log("If everything is ok, open: http://localhost:8000 in your browser to see the page.")
})