-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
43 lines (37 loc) · 1.08 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
var gulp = require('gulp');
var del = require('del');
var runSequence = require('run-sequence');
var jshint = require('gulp-jshint');
var usemin = require('gulp-usemin');
var uglify = require('gulp-uglify');
var minifyCss = require('gulp-minify-css');
var rev = require('gulp-rev');
gulp.task('del', function(cb) {
del('rsm/static/**', cb);
});
gulp.task('lint', function() {
gulp.src(['static/js/*.js'])
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('usemin', function() {
gulp.src('static/index.html')
.pipe(usemin({
assetsDir: 'static',
css: [minifyCss(),rev()],
js: [uglify(), rev()]
//js: [uglify({mangle: false}), rev()]
}))
.pipe(gulp.dest('rsm/static'));
});
gulp.task('bootstrap-fonts', function() {
gulp.src('static/vendor/bootstrap/dist/fonts/*')
.pipe(gulp.dest('rsm/static/fonts'));
});
gulp.task('img', function() {
gulp.src('static/img/*')
.pipe(gulp.dest('rsm/static/img'));
});
gulp.task('default', function() {
runSequence('del', ['usemin', 'img', 'bootstrap-fonts', 'lint']);
});