-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgulpfile.js
More file actions
36 lines (32 loc) · 1008 Bytes
/
gulpfile.js
File metadata and controls
36 lines (32 loc) · 1008 Bytes
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
const babel = require("gulp-babel");
const babelRegister = require('babel-register');
const concat = require("gulp-concat");
const gulp = require('gulp');
const jshint = require('gulp-jshint');
const mocha = require('gulp-mocha');
const sourcemaps = require("gulp-sourcemaps");
const watch = require('gulp-watch');
gulp.task('default', ['compile', 'test']);
gulp.task('watch', function() {
gulp.watch(['spec/**', 'src/**'], { ignoreInitial: false }, ['compile', 'test']);
});
gulp.task("compile", function () {
gulp
.src("src/**.js")
.pipe(jshint({esversion: 6}))
.pipe(jshint.reporter('default'))
.pipe(sourcemaps.init())
.pipe(babel({
"plugins": ["transform-es2015-modules-umd"]
}))
.pipe(gulp.dest("dist"));
});
gulp.task('test', function() {
gulp
.src(['spec/*.js'])
.pipe(jshint({esversion: 6}))
.pipe(jshint.reporter('default'))
.pipe(mocha({
compilers:babelRegister
}));
});