-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathgulpfile.js
More file actions
53 lines (48 loc) · 1.62 KB
/
gulpfile.js
File metadata and controls
53 lines (48 loc) · 1.62 KB
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
// Include gulp
var gulp = require('gulp');
var connect = require('gulp-connect');
var uglify = require('gulp-uglify');
var minifyHtml = require('gulp-minify-html');
var minifyCss = require('gulp-minify-css');
var usemin = require('gulp-usemin');
var rev = require('gulp-rev');
var clean = require('gulp-clean');
var karma = require('gulp-karma');
gulp.task('copy-html-files', function() {
gulp.src(['./app/**/*.html', './app/ttc-stations.json', '!./app/index.html'], {base: './app'})
.pipe(gulp.dest('build/'));
});
gulp.task('usemin', function() {
gulp.src('./app/index.html')
.pipe(usemin({
css: [minifyCss(), 'concat', rev()],
js: [uglify(), rev()]
}))
.pipe(gulp.dest('build/'));
});
gulp.task('connect', function() {
connect.server({
root: 'app/'
});
});
gulp.task('test', function() {
var files = [
'./app/bower_components/jquery/dist/jquery.js',
'./app/bower_components/underscore/underscore.js',
'./app/bower_components/angular/angular.js',
'./app/bower_components/angular-animate/angular-animate.js',
'./app/bower_components/angular-route/angular-route.js',
'./app/bower_components/angular-messages/angular-messages.js',
'./app/bower_components/angular-embedly/angular-embedly.js',
'./app/bower_components/angular-mocks/angular-mocks.js',
'./app/app.js',
'./app/scrapbook-entry-template.html',
'./app/scrapbook-embed-field-template.html',
'./test/appSpec.js'
];
gulp.src(files)
.pipe(karma({ configFile: 'karma.conf.js', action: 'watch' }));
});
// Default Task
gulp.task('default', ['connect']);
gulp.task('build', ['copy-html-files', 'usemin']);