-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
40 lines (34 loc) · 918 Bytes
/
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
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var babel = require('gulp-babel');
var sourcemaps = require('gulp-sourcemaps');
var del = require('del');
var path = require('path');
var raptorLintSrc = [
'./index.js',
'./lib/**/*.js'
];
var raptorBuildSrc = [
path.join(__dirname, './index.js'),
path.join(__dirname, './lib/**/*.js'),
path.join(__dirname, './tests/*.js')
];
var sourceRoot = path.join(__dirname, '.');
gulp.task('lint', function() {
return gulp.src(raptorLintSrc)
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('clean', function() {
return del([
'dist/**/*'
]);
});
gulp.task('build', ['clean'], function() {
return gulp.src(raptorBuildSrc, { base: '.' })
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('maps', { sourceRoot: sourceRoot }))
.pipe(gulp.dest('dist/es5'));
});