-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
46 lines (37 loc) · 1005 Bytes
/
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
'use scrict'
var gulp = require('gulp')
var jade = require('gulp-jade')
var postcss = require('gulp-postcss')
var processors = [
require('postcss-nested'),
require('autoprefixer-core')()
]
var cssmin = require('gulp-minify-css')
var uglify = require('gulp-uglify')
var watchJS
gulp.task('jade', function () {
return gulp.src('src/index.jade')
.pipe(jade())
.pipe(gulp.dest('dist'))
})
gulp.task('css', function () {
return gulp.src('src/css/main.css')
.pipe(postcss(processors))
.pipe(cssmin())
.pipe(gulp.dest('dist/css'))
})
gulp.task('js', function () {
return gulp.src('src/js/main.js')
.pipe(uglify())
.pipe(gulp.dest('dist/js'))
})
gulp.task('assets', function () {
return gulp.src(['assets/**/*'])
.pipe(gulp.dest('dist/assets'))
})
gulp.task('watch', function () {
gulp.watch('src/index.jade', ['jade'])
gulp.watch('src/css/main.css', ['css'])
gulp.watch('src/js/main.js', ['js'])
})
gulp.task('default', ['jade', 'css', 'js', 'assets'])