-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
78 lines (59 loc) · 1.55 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
69
70
71
72
73
74
75
76
77
78
var gulp = require('gulp');
var replace = require('gulp-replace');
var browserify = require('browserify');
var argv = require('yargs').argv;
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var o = require('open');
var ripple = require('ripple-emulator');
var sourcemaps = require('gulp-sourcemaps');
var del = require('del');
gulp.task('static', function() {
gulp.src('./src/index.html')
.pipe(gulp.dest('www'));
gulp.src('./src/img/**/*')
.pipe(gulp.dest('www/img'));
gulp.src('./src/app/**/*')
.pipe(gulp.dest('www/app'));
gulp.src('./src/common/**/*')
.pipe(gulp.dest('www/common'));
});
gulp.task('stylesheets', function() {
return gulp.src('./src/css/**/*.css')
.pipe(gulp.dest('www/css'));
});
gulp.task('build', ['static', 'stylesheets']);
gulp.task('watch', ['build'], function() {
gulp.watch([
'./src/app/**/*',
'./src/common/**/*',
'./srcindex.html',
'./srcimg/**/*'],
function() {
gulp.run('static');
});
gulp.watch('./src/css/**', function() {
gulp.run('stylesheets');
});
});
gulp.task('default', ['watch'], function() {
var options = {
keepAlive: false,
open: true,
port: 4400
};
// Start the ripple server
ripple.emulate.start(options);
//TODO add livereload to ripple
if (options.open) {
o('http://localhost:' + options.port + '?enableripple=cordova-3.0.0');
}
});
gulp.task('clean', function () {
return del([
'www/**/*',
'!www',
'!www/bower_components',
'!www/bower_components/**/*'
]);
});