-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgulpfile.js
More file actions
55 lines (46 loc) · 1.36 KB
/
gulpfile.js
File metadata and controls
55 lines (46 loc) · 1.36 KB
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
/* global require */
var gulp = require('gulp');
var templateCache = require('gulp-angular-templatecache');
var minifyHtml = require('gulp-minify-html');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var streamqueue = require('streamqueue');
var jscs = require('gulp-jscs');
var tsc = require('gulp-tsc');
gulp.task('build', function () {
var stream = streamqueue({objectMode: true});
stream.queue(
gulp.src('./src/*.html')
.pipe(minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe(templateCache({
module: 'schemaForm',
root: 'directives/decorators/bootstrap/complex-ui/'
}))
);
stream.queue(
gulp.src(['src/**/*.ts'])
.pipe(tsc())
);
stream.done()
.pipe(concat('angular-schema-form-complex-ui.js'))
.pipe(gulp.dest('.'));
});
gulp.task('minify', function () {
var stream = streamqueue({objectMode: true});
stream.queue(gulp.src('angular-schema-form-complex-ui.js'));
stream.done()
.pipe(uglify())
.pipe(concat('angular-schema-form-complex-ui.min.js'))
.pipe(gulp.dest('.'))
});
gulp.task('default', [
'build',
'minify'
]);
gulp.task('watch', function () {
gulp.watch('./src/**/*', ['default']);
});