-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
gulpfile.js
59 lines (54 loc) · 1.42 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
50
51
52
53
54
55
56
57
58
59
var gulp = require('gulp');
var concat = require('gulp-concat');
var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify-es').default;
var header = require('gulp-header');
var babel = require('gulp-babel');
var rename = require('gulp-rename');
var order = require("gulp-order");
gulp.task('js', function(){
return gulp.src('src/**/*.js')
.pipe(sourcemaps.init())
.pipe(order([
'a_init.js',
'**/*.js',
'z_extra.js'
]))
.pipe(concat('SFMediaStream.js'))
.pipe(gulp.dest('dist'))
.pipe(rename('SFMediaStream.min.js'))
.pipe(babel({
"presets": [
[
"@babel/preset-env",
{
"targets": {
"ie": "11"
},
modules: false,
loose: false,
shippedProposals: true
}
]
]
}))
.on('error', swallowError)
.pipe(uglify())
.on('error', swallowError)
.pipe(header(`/*
SFMediaStream
HTML5 media streamer library for playing music, video, playlist,
or even live streaming microphone & camera with node server
https://github.com/ScarletsFiction/SFMediaStream
*/\n`))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', function() {
gulp.watch(['src/**/*.js'], gulp.series('js'));
});
gulp.task('default', gulp.series('js'));
function swallowError(error){
console.log(error.message)
this.emit('end')
}