-
Notifications
You must be signed in to change notification settings - Fork 68
/
gulpfile.js
45 lines (39 loc) · 1.2 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var header = require('gulp-header');
var bower = require('./bower.json');
var banner = [
'/**',
' * <%= bower.name %> - <%= bower.description %>',
' * @version <%= bower.version %>',
' * @link <%= bower.homepage %>',
' * @author <%= bower.authors.join(", ") %>',
' * @license <%= bower.license %>',
' */', '', ''].join('\n');
gulp.task('lint', function () {
return gulp.src('src/jr-crop.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('scripts', function () {
return gulp.src('src/jr-crop.js')
.pipe(header(banner, { bower: bower } ))
.pipe(gulp.dest('dist'))
.pipe(rename('jr-crop.min.js'))
.pipe(uglify())
.pipe(header(banner, { bower: bower } ))
.pipe(gulp.dest('dist'));
});
gulp.task('style', function () {
return gulp.src('src/jr-crop.scss')
.pipe(sass())
.pipe(header(banner, { bower: bower } ))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', function() {
gulp.watch('src/**/*', ['default']);
});
gulp.task('default', ['lint', 'scripts', 'style']);