-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
58 lines (51 loc) · 1.49 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
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var paths = {
js: ["js/gorilla.scroller.js", "js/*.js", "js/**/*.js"],
sass: ["scss/gorilla.scroller.scss"]
};
gulp.task("lint", function () {
return gulp.src(paths.js)
.pipe($.jshint())
.pipe($.jshint.reporter("default"));
});
gulp.task("minify", ["lint"], function () {
return gulp.src(paths.js)
.pipe($.sourcemaps.init())
.pipe($.uglify())
.pipe($.concat("gorilla.scroller.min.js"))
.pipe($.sourcemaps.write())
.pipe(gulp.dest("dist"));
});
gulp.task("js", ["minify"], function () {
return gulp.src(paths.js)
.pipe($.concat("gorilla.scroller.js"))
.pipe(gulp.dest("dist"));
});
gulp.task('sass-minify', function () {
return gulp.src(paths.sass)
.pipe($.sourcemaps.init())
.pipe($.sass({
outputStyle: 'compressed'
}).on('error', $.sass.logError))
.pipe($.autoprefixer({
browsers: ['last 2 versions', 'ie >= 9']
}))
.pipe($.sourcemaps.write())
.pipe($.concat("gorilla.scroller.min.css"))
.pipe(gulp.dest('dist'));
});
gulp.task('sass', ['sass-minify'], function () {
return gulp.src(paths.sass)
.pipe($.sass({
outputStyle: 'expanded'
}).on('error', $.sass.logError))
.pipe($.autoprefixer({
browsers: ['last 2 versions', 'ie >= 9']
}))
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['sass', 'js'], function () {
gulp.watch(["scss/*.scss"], ['sass']);
gulp.watch(paths.js, ['minify']);
});