-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
53 lines (49 loc) · 1.27 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
const gulp = require('gulp'),
browserify = require('browserify'),
babelify = require('babelify'),
uglify = require('gulp-uglify'),
source = require('vinyl-source-stream'),
rename = require('gulp-rename'),
buffer = require('gulp-buffer'),
uglifycss = require('gulp-uglifycss')
fs = require('fs');
const libs = ['./js/lib/shaka-player.compiled.js'];
gulp.task('build', () => {
const b = browserify({
entries: [ 'js/index.js' ],
noParse: libs,
debug: true,
})
.transform(babelify, {
presets: [ 'es2015' ],
ignore: /\js\/lib\//
})
.bundle()
.pipe(source('player.js'))
.pipe(gulp.dest('public/js/'))
});
gulp.task('stylesheets', () => {
return gulp.src('public/stylesheets/player.css')
.pipe(uglifycss())
.pipe(rename('eyevinnplayer.css'))
.pipe(rename({ extname: ".min.css" }))
.pipe(gulp.dest('dist/stylesheets'))
});
gulp.task('prod', ['stylesheets'], () => {
const b = browserify({
entries: [ 'js/index.js' ],
noParse: libs,
debug: true,
})
.transform(babelify, {
presets: [ 'es2015' ],
ignore: /\js\/lib\//
})
.bundle()
.pipe(source('player.js'))
.pipe(buffer())
.pipe(rename('eyevinnplayer.js'))
.pipe(rename({ extname: ".min.js" }))
.pipe(uglify())
.pipe(gulp.dest('dist/js/'))
});