-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (31 loc) · 937 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
const gulp = require('gulp');
const babel = require('gulp-babel');
const rimraf = require('gulp-rimraf');
const flatten = require('gulp-dot-flatten');
const screeps = require('gulp-screeps');
// const credentials_local = require('./credentials_local');
const scriptSelectorSrc = 'src/**/*.js';
const scriptSelectorDist = 'dist/**/*.js';
gulp.task('rimraf', (done) => {
gulp.src(scriptSelectorDist, { read: false })
.pipe(rimraf());
done();
});
gulp.task('distribute', (done) => {
gulp.src(scriptSelectorSrc)
.pipe(babel())
.pipe(flatten())
.pipe(gulp.dest('dist'));
done();
});
/*
gulp.task('publish_local', (done) => {
gulp.src(scriptSelectorDist)
.pipe(screeps(credentials_local));
done();
});
*/
//default-task
gulp.task('default', gulp.series('rimraf', 'distribute', function watcher() {
gulp.watch(scriptSelectorSrc, gulp.series('rimraf', 'distribute'));
}));