-
Notifications
You must be signed in to change notification settings - Fork 8
/
gulpfile.js
44 lines (40 loc) · 1 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var umd = require('gulp-umd');
gulp.task('build', ['build-minify', 'build-debug', 'build-docs']);
gulp.task('build-minify', function (cb) {
return gulp.src(['src/**/*.js'])
.pipe(concat('indent.min.js'))
.pipe(umd({
exports: function (file) {
return 'indent';
},
namespace: function (file) {
return 'indent';
}
}))
.pipe(uglify({
mangleProperties: {
regex: /^\$/
}
}))
.pipe(gulp.dest('./lib'))
});
gulp.task('build-docs', ['build-minify'], function (cb) {
return gulp.src(['lib/**/*.min.js'])
.pipe(gulp.dest('./docs/js'))
});
gulp.task('build-debug', function (cb) {
return gulp.src(['src/**/*.js'])
.pipe(concat('indent.js'))
.pipe(umd({
exports: function (file) {
return 'indent';
},
namespace: function (file) {
return 'indent';
}
}))
.pipe(gulp.dest('./lib'));
});