forked from AcelisWeaven/arrow-hero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
executable file
·71 lines (62 loc) · 1.72 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
63
64
65
66
67
68
69
70
71
var gulp = require('gulp'),
gulpLoadPlugins = require('gulp-load-plugins'),
jshint = require('gulp-jshint'),
plugins = gulpLoadPlugins(),
autoprefixer = require('gulp-autoprefixer'),
sourcemaps = require('gulp-sourcemaps'),
ghPages = require('gulp-gh-pages');
var app = 'src';
var onError = function(err) {
console.log(err);
};
gulp.task('Sass', function() {
gulp.src(app + '/scss/**/*.scss')
.pipe(plugins.plumber({
errorHandler: onError
}))
.pipe(sourcemaps.init())
.pipe(plugins.rubySass({
style: 'expanded',
check: true,
"sourcemap=none": true
}))
.pipe(plugins.rename({suffix: '.min'}))
.pipe(autoprefixer({
browsers: ['last 3 versions'],
cascade: false
}))
.pipe(plugins.minifyCss({keepSpecialComments:0}))
.pipe(sourcemaps.write())
.pipe(gulp.dest('app/dist/css/'));
});
gulp.task('concat', function() {
gulp.src([
app + '/vendor/**.js',
app + '/js/**.js'
])
.pipe(plugins.concat('app.js'))
.pipe(plugins.uglify({mangle: true}))
.pipe(plugins.rename({suffix: '.min'}))
.pipe(gulp.dest('app/dist/js/'));
});
gulp.task('lint', function() {
return gulp.src(app + '/js/**.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('watch', function() {
gulp.watch(app + '/scss/**/*.scss', ['Sass']);
gulp.watch([
app + '/vendor/**.js',
app + '/js/**.js'
], ['concat', 'lint']);
});
gulp.task('deploy', function() {
return gulp.src('./app/**/*')
.pipe(ghPages());
});
gulp.task('default', [
'concat',
'Sass',
'lint'
]);