-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
49 lines (46 loc) · 1.3 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* Gulp Settings
* Created by Alexey S. Kiselev.
*/
let gulp = require('gulp'),
replace = require('gulp-replace-path'),
babel = require('gulp-babel');
// Bundle main Index File
gulp.task('build:node', function(done) {
gulp.src([
'./index.js',
'./core/**/*.js'
]).
on('error', function(e){
console.error('Error occurred during build: ' + e);
this.emit('end');
}).
pipe(babel({
presets: ['@babel/preset-env', '@babel/preset-flow'],
plugins: [
[
'@babel/plugin-proposal-decorators',
{
'legacy': true
}
]
]
})).
on('error', function(e){
console.error('Error occurred during build: ' + e);
this.emit('end');
}).
pipe(replace(/(\/core)/g,'')).
on('error', function(e){
console.error('Error occurred during build: ' + e);
this.emit('end');
}).
pipe(gulp.dest('./lib/')).
on('error', function(e){
console.error('Error occurred during build: ' + e);
this.emit('end');
});
done();
});
// Default task
gulp.task('default', gulp.series('build:node'));