forked from json-schema-form/angular-schema-form-material
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
67 lines (59 loc) · 1.56 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
65
66
67
var gulp = require('gulp'),
streamqueue = require('streamqueue'),
minifyHtml = require('gulp-minify-html'),
templateCache = require('gulp-angular-templatecache'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
jscs = require('gulp-jscs');
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: 'decorators/material/'
}))
);
stream.queue(gulp.src('./src/**/*.js'));
stream.done()
.pipe(concat('material-decorator.js'))
.pipe(gulp.dest('./'))
.pipe(uglify())
.pipe(rename('material-decorator.min.js'))
.pipe(gulp.dest('./'));
});
gulp.task('templates', 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: 'decorators/material/'
}))
);
stream.done()
.pipe(concat('angular-schema-form-material-templates.js'))
.pipe(gulp.dest('./src'))
.pipe(uglify())
.pipe(rename('angular-schema-form-material-templates.min.js'))
.pipe(gulp.dest('./src'));
});
gulp.task('jscs', function() {
gulp.src('./src/**/*.js')
.pipe(jscs());
});
gulp.task('watch', function() {
gulp.watch('./src/**/*', [ 'default' ]);
});
gulp.task('default', [ 'templates' ]);