-
Notifications
You must be signed in to change notification settings - Fork 42
/
gulpfile.js
64 lines (57 loc) · 2.03 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
60
61
62
63
64
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var browserify = require('gulp-browserify');
var rename = require('gulp-rename');
var gzip = require('gulp-gzip');
// creates a non-minified, browser-ready version of citation.js
gulp.task('browser', function () {
return gulp.src('citation.js')
.pipe(browserify({debug: false}))
.pipe(rename('citation.js'))
.pipe(gulp.dest('browser'));
});
// creates a minified, browser-ready version of citation.js
gulp.task('browser-minified', function () {
return gulp.src('citation.js')
.pipe(browserify({debug: false}))
.pipe(uglify())
.pipe(rename('citation.min.js'))
.pipe(gulp.dest('browser'));
});
// creates a minified and gzipped, browser-ready version of citation.js
gulp.task('browser-gzip', function () {
return gulp.src('citation.js')
.pipe(browserify({debug: false}))
.pipe(uglify())
.pipe(gzip())
.pipe(rename('citation.min.js.gz'))
.pipe(gulp.dest('browser'));
});
// creates a non-minified, browser-ready version of citation.js
gulp.task('walverine-browser', function () {
return gulp.src('citation-with-walverine.js')
.pipe(browserify({debug: false}))
.pipe(rename('citation-with-walverine.js'))
.pipe(gulp.dest('browser'));
});
// creates a minified, browser-ready version of citation.js
gulp.task('walverine-browser-minified', function () {
return gulp.src('citation-with-walverine.js')
.pipe(browserify({debug: false}))
.pipe(uglify())
.pipe(rename('citation-with-walverine.min.js'))
.pipe(gulp.dest('browser'));
});
// creates a minified and gzipped, browser-ready version of citation.js
gulp.task('walverine-browser-gzip', function () {
return gulp.src('citation-with-walverine.js')
.pipe(browserify({debug: false}))
.pipe(uglify())
.pipe(gzip())
.pipe(rename('citation-with-walverine.min.js.gz'))
.pipe(gulp.dest('browser'));
});
gulp.task('default', [
'browser', 'browser-minified', 'browser-gzip',
'walverine-browser', 'walverine-browser-minified', 'walverine-browser-gzip'
]);