-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpFile.js
46 lines (43 loc) · 1.3 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
/**
* @file gulp file
* @author [email protected]
*/
var gulp = require('gulp');
var ngTemplate = require('gulp-ng-template');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var eventStream = require('event-stream');
var order = require('gulp-order');
var less = require('gulp-less');
var minifyCss = require('gulp-minify-css');
var ngAnnotate = require('gulp-ng-annotate');
gulp.task('build', function () {
return eventStream.merge(
gulp.src('src/js/angular-tree-view-item.js'),
gulp.src('src/js/angular-tree-view.js'),
createTemplate()
)
.pipe(order(['**/angular-tree-view-item.js', '**/angular-tree-view.js', '**/templates.js']))
.pipe(concat('angular-tree-view.js'))
.pipe(gulp.dest('dist'))
.pipe(ngAnnotate())
.pipe(uglify())
.pipe(rename('angular-tree-view.min.js'))
.pipe(gulp.dest('dist'));
});
gulp.task('css', function () {
return gulp.src('src/less/*.less')
.pipe(less())
.pipe(gulp.dest('./dist'))
.pipe(minifyCss())
.pipe(rename('angular-tree-view.min.css'))
.pipe(gulp.dest('./dist'));
});
function createTemplate() {
return gulp.src('src/template/*.tpl')
.pipe(ngTemplate({
moduleName: 'TreeView',
filePath: './templates.js'
}));
}