-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
gulpfile.js
40 lines (35 loc) · 1.01 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var htmlhint = require('gulp-htmlhint');
var htmlmin = require('gulp-htmlmin');
var autoprefixer = require('gulp-autoprefixer');
var csso = require('gulp-csso');
var ghPages = require('gulp-gh-pages');
gulp.task('js', function () {
gulp.src('./src/dragNdrop.js')
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(gulp.dest('./dist/'))
.pipe(uglify())
.pipe(rename('dNd.min.js'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('css', function () {
gulp.src('./src/example.css')
.pipe(autoprefixer())
.pipe(csso())
.pipe(gulp.dest('./dist/'));
});
gulp.task('html', function () {
gulp.src('./src/index.html')
.pipe(htmlhint())
.pipe(htmlmin({collapseWhitespace: true}))
.pipe(gulp.dest('./dist/'));
});
gulp.task('deploy', function () {
return gulp.src('./dist/**/*')
.pipe(ghPages());
});
gulp.task('default', ['js', 'html', 'css']);