forked from opus-1/store-api-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGulpfile.js
More file actions
32 lines (27 loc) · 885 Bytes
/
Gulpfile.js
File metadata and controls
32 lines (27 loc) · 885 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
'use strict';
const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const babel = require('gulp-babel');
const concat = require('gulp-concat');
const watch = require('gulp-watch');
const mocha = require('gulp-mocha');
gulp.task('test', ["compile"], () => {
gulp.src('tests/*.js', {read: false})
.pipe(mocha({reporter: 'spec', growl: true}));
});
gulp.task('compile', ()=> {
return gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(babel({
presets: ['es2015']
}))
.pipe(concat('dist.js'))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', ()=>{
gulp.watch('src/*.js', ['test'])
gulp.watch('src/**/*.js', ['test'])
return gulp.watch('tests/*.js', ['test'])
});
gulp.task('default', ["compile", "watch", "test"])