-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
31 lines (28 loc) · 966 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
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var webpack = require("gulp-webpack");
var babel = require('gulp-babel');
gulp.task('eslint', function () {
return gulp.src(['src/**', 'docs/src/**/*.{js,jsx}'])
// eslint() attaches the lint output to the eslint property
// of the file object so it can be used by other modules.
.pipe(eslint())
// eslint.format() outputs the lint results to the console.
// Alternatively use eslint.formatEach() (see Docs).
.pipe(eslint.format())
// To have the process exit with an error code (1) on
// lint error, return the stream and pipe to failOnError last.
.pipe(eslint.failOnError());
});
gulp.task('webpack', function() {
return gulp.src('lib/index.js')
.pipe(webpack())
.pipe(gulp.dest('dist/'));
});
gulp.task('build', function() {
return gulp.src('src/index.js')
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest('lib'));
});