-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
68 lines (59 loc) · 1.99 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
68
var _ = require('lodash');
var gulp = require('gulp');
var config = require('./gulp.config')();
var templateCache = require('gulp-angular-templatecache');
var minifyHtml = require('gulp-minify-html');
var concat = require('gulp-concat');
var del = require('del');
gulp.task('templatecache', function() {
console.log('creating angularjs $templateCache');
return gulp
.src(config.htmltemplates)
.pipe(minifyHtml({ empty: true }))
.pipe(templateCache(
config.templateCache.file,
config.templateCache.options
))
.pipe(gulp.dest(config.build));
});
gulp.task('concat-scripts', function() {
return gulp.src(config.jsfiles)
.pipe(concat('app.js'))
.pipe(gulp.dest(config.build));
});
gulp.task('concat-libs', function() {
return gulp.src(config.jsfiles)
.pipe(concat('libs.js'))
.pipe(gulp.dest(config.build));
});
gulp.task('clean-code', function(done) {
var files = [].concat(
config.temp + '**/*.js',
config.build + '**/*.html',
config.build + '**/*.js'
);
clean(files, done);
});
gulp.task('copy-assets', function() {
var assets = {
js: [
'./node_modules/angular/angular.min.js',
'./node_modules/angular-ui-router/release/angular-ui-router.min.js',
'./node_modules/angular-material/angular-material.min.js',
'./node_modules/angular-animate/angular-animate.min.js',
'./node_modules/angular-aria/angular-aria.min.js',
'./node_modules/angular-messages/angular-messages.min.js',
// './node_modules/angular-sanitize/angular-sanitize.min.js',
],
css: [
'./node_modules/angular-material/angular-material.min.css'
]
};
_(assets).forEach(function(asset, type) {
gulp.src(asset).pipe(gulp.dest('./src/assets/libs/' + type));
});
});
gulp.task("default", ['clean-code', 'copy-assets']);
function clean(files, done) {
del(files, done);
}