-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
33 lines (29 loc) · 949 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
const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const babel = require('gulp-babel');
const changed = require('gulp-changed');
gulp.task('compile:src', () => {
return gulp.src('src/**/*.js')
.pipe(changed('packages/app-decorators/src'))
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('packages/app-decorators/src'))
.pipe(gulp.dest('packages/app-decorators/lib'));
});
gulp.task('compile:test', () => {
return gulp.src('test/**/*.js')
.pipe(changed('packages/app-decorators/test'))
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('packages/app-decorators/test'));
});
gulp.task('watch', function() {
gulp.watch(
['src/**/*.js', 'test/**/*.js'],
['compile:src', 'compile:test']
);
});
gulp.task('compile', ['compile:src', 'compile:test']);
gulp.task('compile-watch', ['compile:src', 'compile:test', 'watch']);