-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
gulpfile.js
52 lines (46 loc) · 1.38 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
var g = require('gulp')
var concat = require('gulp-concat')
var uglify = require('gulp-uglify')
var cssmin = require('gulp-cssmin')
var gutil = require('gulp-util')
var ngAnnotate = require('gulp-ng-annotate')
var templateCache = require('gulp-angular-templatecache')
g.task('template-cache', function () {
return g.src('src/**/*.html')
.pipe(templateCache('templates.js', {
module: 'linuxDash',
standAlone: false,
root: 'src/'
}))
.pipe(g.dest('temp/'))
})
g.task('generate-js-dist', ['template-cache'], function () {
return g.src([
'node_modules/angular/angular.min.js',
'node_modules/angular-route/angular-route.min.js',
'node_modules/smoothie/smoothie.js',
'node_modules/sortablejs/Sortable.min.js',
'src/js/**/*.js',
'temp/templates.js'
])
.pipe(concat('linuxDash.min.js'))
.pipe(ngAnnotate())
// .pipe(uglify())
.on('error', gutil.log)
.pipe(g.dest('app/'))
})
g.task('generate-css-dist', function () {
return g.src([ 'src/**/*.css' ])
.pipe(cssmin())
.pipe(concat('linuxDash.min.css'))
.pipe(g.dest('app/'))
})
g.task('build', [
'generate-js-dist',
'generate-css-dist'
])
g.task('watch', function () {
g.watch('src/**/*.css', ['generate-css-dist'])
g.watch(['src/**/*.js', 'src/**/*.html'], ['generate-js-dist'])
})
g.task('default', ['build', 'watch'])