-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
36 lines (34 loc) · 994 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
var gulp = require('gulp')
var webpack = require('gulp-webpack')
var uglify = require('gulp-uglifyjs')
var header = require('gulp-header')
var meta = require('./package.json')
var banner = ['/**',
'* Mux.js v${version}',
'* (c) 2014 ${author}',
'* Released under the ${license} License.',
'*/',
''].join('\n')
var bannerVars = {
version : meta.version,
author: 'guankaishe',
license: 'MIT'
}
gulp.task('default', function() {
return gulp.src('index.js')
.pipe(webpack({
output: {
library: 'Mux',
libraryTarget: 'umd',
filename: 'mux.js'
}
}))
.pipe(header(banner, bannerVars))
.pipe(gulp.dest('dist/'))
.pipe(uglify('mux.min.js', {
mangle: true,
compress: true
}))
.pipe(header(banner, bannerVars))
.pipe(gulp.dest('dist/'))
});