-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
44 lines (39 loc) · 1.11 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
var gulp = require('gulp'),
minifyCSS = require('gulp-minify-css'),
sass = require('gulp-sass'),
browserify = require('gulp-browserify'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
replace = require('gulp-replace'),
jshint = require('gulp-jshint'),
path = require('path');
gulp.task('sass', function () {
return gulp.src('sass/**/*.scss')
.pipe(sass())
.pipe(minifyCSS())
.pipe(gulp.dest('./'));
});
gulp.task('jshint', function() {
return gulp.src(['js/coderesponsible.js'])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('scripts', function() {
gulp.src('js/*.js')
.pipe(browserify({
insertGlobals : true,
transform: ['babelify'],
debug : !gulp.env.production
}))
.pipe(uglify())
.pipe(rename({
extname: '.min.js'
}))
.pipe(replace('./build/js/*.min.js'))
.pipe(gulp.dest('./build/js'));
});
gulp.task('watch', function() {
gulp.watch('js/**/*.js', ['scripts']);
gulp.watch('sass/**/*.scss', ['sass']);
});
gulp.task('default', ['watch']);