forked from gilbarbara/react-joyride
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
54 lines (48 loc) · 1.36 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
var gulp = require('gulp'),
$ = require('gulp-load-plugins')(),
babelRegister = require('babel-register'),
del = require('del'),
merge = require('merge-stream'),
runSequence = require('run-sequence');
// Script
gulp.task('lint', function() {
return gulp.src('lib/scripts/*')
.pipe($.eslint({
useEslintrc: true,
rules: {
"no-console": 2
}
}))
.pipe($.eslint.format())
.pipe($.eslint.failOnError());
});
gulp.task('test', function() {
return gulp.src('tests/*.js', {
read: false
})
.pipe($.mocha({
reporter: 'spec',
compilers: {
js: babelRegister
}
}));
});
gulp.task('styles', function() {
return gulp.src('lib/styles/*.scss')
.pipe($.plumber())
.pipe($.sass.sync({
precision: 4
}).on('error', $.sass.logError))
.pipe($.plumber.stop())
.pipe($.autoprefixer())
.pipe($.rename({ suffix: '-compiled' }))
.pipe(gulp.dest('lib/styles'));
});
gulp.task('clean', function(cb) {
return del(['lib/styles/*.css'], cb);
});
gulp.task('build', ['clean'], function(cb) {
process.env.NODE_ENV = 'production';
runSequence('lint', 'styles', cb);
});
gulp.task('default', ['build']);