forked from joni2back/angular-filemanager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (44 loc) · 1.47 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
'use strict';
// Require
var gulp = require('gulp');
var templateCache = require('gulp-angular-templatecache'); // caches the templates with $templateCache
var uglify = require('gulp-uglify'); // minifies JavaScript
var minifyCss = require('gulp-minify-css'); // minifies CSS
var concat = require('gulp-concat'); // concat JavaScript
var path = require('path');
// Vars
var src = './assets/';
var dst = './dist/';
gulp.task('cache-templates', function () {
return gulp.src(src + 'templates/*.html')
.pipe(templateCache('cached-templates.js', {
module: 'FileManagerApp',
base: function(file) {
return 'assets/templates/' + path.basename(file.history);
}
}))
.pipe(gulp.dest(dst));
});
gulp.task('concat-uglify-js', function() {
return gulp.src([
'assets/js/app.js',
'assets/js/config.js',
'assets/js/chmod.js',
'assets/js/controller.js',
'assets/js/filenavigator.js',
'assets/js/fileuploader.js',
'assets/js/item.js',
'assets/js/selector-controller.js',
'assets/js/translations.js'
])
.pipe(concat('angular-filemanager.min.js'))
.pipe(uglify())
.pipe(gulp.dest(dst))
});
gulp.task('minify-css', function() {
return gulp.src(src + 'css/*.css')
.pipe(minifyCss({compatibility: 'ie8'}))
.pipe(gulp.dest(dst));
});
gulp.task('default', ['cache-templates', 'concat-uglify-js', 'minify-css']);
gulp.task('build', ['default']);