-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
51 lines (41 loc) · 1.33 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
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'),
wrap = require('gulp-wrap');
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(wrap('define(["angular","schemaForm"],function(angular,schemaForm){\n<%=contents%>\n});'))
.pipe(gulp.dest('./'))
.pipe(gulp.dest('../'))
.pipe(uglify())
.pipe(rename('material-decorator.min.js'))
.pipe(gulp.dest('./'));
});
gulp.task('jscs', function () {
gulp.src('./src/**/*.js')
.pipe(jscs());
});
gulp.task('watch', function () {
gulp.watch('./src/**/*', ['default']);
});
gulp.task('default', ['build']);