-
Notifications
You must be signed in to change notification settings - Fork 9
/
gulpfile.js
46 lines (39 loc) · 1.34 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
var gulp = require('gulp');
var uglify = require("gulp-uglify");
var uglifycss = require("gulp-uglifycss");
var rename = require('gulp-rename');
var changelog = require('gulp-conventional-changelog');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var del = require('del');
var eslint = require('gulp-eslint');
gulp.task('min', function() {
gulp.src('js/jquery.loadingModal.js')
.pipe(uglify({preserveComments: 'license'}))
.pipe(rename('js/jquery.loadingModal.min.js'))
.pipe(gulp.dest('.'));
gulp.src('css/jquery.loadingModal.css')
.pipe(uglifycss())
.pipe(rename('css/jquery.loadingModal.min.css'))
.pipe(gulp.dest('.'));
});
gulp.task('clean-styles', function(cb) {
del(['css'], cb);
});
gulp.task('lint', () => {
return gulp.src(['**/*.js','!node_modules/**','!gulpfile.js','!**/*.min.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('styles', ['clean-styles'], function() {
return gulp.src('scss/*.scss')
.pipe(sass({errLogToConsole: true}))
.pipe(autoprefixer('last 2 versions', {map: false}))
.pipe(gulp.dest('css'));
});
gulp.task('build', ['styles', 'lint']);
gulp.task('default', ['build']);
gulp.task('watch', ['build'], function() {
gulp.watch('scss/**/*.scss', ['build']);
});