-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
56 lines (46 loc) · 2.21 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
/// <vs AfterBuild='build' />
'use strict';
var config = require('./build/config.json');
var gulp = require('gulp');
var log = require('./build/logger.js');
var generateJS = require('./build/generate-js/generate-js-task');
var compileTemplates = require('./build/compile-templates/compile-templates-task');
var cleanCode = require('./build/clean/clean-task');
var concatJs = require('./build/concat/concat-js-task');
var concatTsd = require('./build/concat/concat-tsd-task');
var uglify = require('./build/uglify/uglify-task');
var runSequence = require('run-sequence');
var server = require('gulp-express');
gulp.task('watch', ['build'], function () {
gulp.watch(config.tsGlob, ['build']);
gulp.watch(config.tplGlob, ['build']);
});
//gulp.task('build', function(callback)
//{
// runSequence('clean-js', ['compile-typescript-dev', 'compile-templates', 'concat-tsd'], 'concat-js', 'uglify-js', callback);
//});
gulp.task('build', function(callback)
{
runSequence('clean-js', ['compile-typescript', 'compile-templates', 'concat-tsd'], 'concat-js', 'uglify-js', callback);
});
gulp.task('default', ['build']);
gulp.task('server', function () {
// Start the server at the beginning of the task
server.run(['demo/app.js']);
log.info('demo server started on http://localhost:' + (process.env.PORT || 5000) + '/index.html');
// Restart the server when file changes
gulp.watch(['demo/**/*.html'], server.notify);
//gulp.watch(['app/styles/**/*.scss'], ['styles:scss']);
//gulp.watch(['{.tmp,app}/styles/**/*.css'], ['styles:css', server.notify]);
//Event object won't pass down to gulp.watch's callback if there's more than one of them.
//So the correct way to use server.notify is as following:
// gulp.watch(['{.tmp,app}/styles/**/*.css'], function(event){
// gulp.run('styles:css');
// server.notify(event);
// //pipe support is added for server.notify since v0.1.5,
// //see https://github.com/gimm/gulp-express#servernotifyevent
// });
//gulp.watch(['app/scripts/**/*.js'], ['jshint']);
//gulp.watch(['app/images/**/*'], server.notify);
//gulp.watch(['app.js', 'routes/**/*.js'], [server.run]);
});