-
-
Notifications
You must be signed in to change notification settings - Fork 314
/
gulpfile.js
42 lines (38 loc) · 1.23 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
var pkg = require('./package.json'),
gulp = require('gulp'),
header = require('gulp-header'),
sass = require('gulp-sass'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
minify = require('gulp-minify-css'),
plumber = require('gulp-plumber'),
banner = ['/*!',
' * SlickNav Responsive Mobile Menu v<%= pkg.version %>',
' * (c) <%= new Date().getFullYear() %> <%= pkg.author.name %>',
' * licensed under <%= pkg.licenses[0].type %>',
' */',
''].join('\n');
gulp.task('sass', function() {
gulp.src('scss/slicknav.scss')
.pipe(plumber())
.pipe(sass())
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('dist'))
.pipe(minify({compatibility: 'ie8'}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', function() {
gulp.watch('scss/**/*.scss', ['sass']);
gulp.watch('*.js', ['js']);
});
gulp.task('js', function() {
return gulp.src('jquery.slicknav.js')
.pipe(plumber())
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('dist'))
.pipe(uglify({preserveComments: 'some'}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['sass','js']);