This repository has been archived by the owner on Jan 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
76 lines (62 loc) · 2.02 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
var gulp = require('gulp'),
$ = require('gulp-load-plugins')();
gulp.task('build', function() {
console.log('--build');
return gulp.src('./src/sqlite.js')
.pipe($.plumber())
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish'))
.pipe($.umd({
dependencies: function(file) {
return [
{
name: 'lodash',
amd: 'lodash',
cjs: 'lodash',
global: 'lodash',
param: 'lodash'
}
]
},
exports: function(file) {
return 'sqlitejs';
},
namespace: function(file) {
return 'sqlitejs';
}
}))
.pipe(gulp.dest('./lib'))
.pipe($.uglify())
.pipe($.rename({ suffix: '.min' }))
.pipe(gulp.dest('./lib'));
});
gulp.task('server', function() {
gulp.src('./')
.pipe($.webserver({
port: 8095,
livereload: true,
directoryListing: true
}));
});
gulp.task('copy-to-cordova', function() {
gulp.src('./vendor/jquery/dist/jquery.min.js')
.pipe(gulp.dest('./cordova/www/jquery.min.js'));
gulp.src('./vendor/jasmine-core/lib/jasmine-core/jasmine.js')
.pipe(gulp.dest('./cordova/www/jasmine.js'));
gulp.src('./vendor/jasmine-core/lib/jasmine-core/jasmine-html.js')
.pipe(gulp.dest('./cordova/www/jasmine-html.js'));
gulp.src('./vendor/jasmine-core/lib/jasmine-core/boot.js')
.pipe(gulp.dest('./cordova/www/boot.js'));
gulp.src('./vendor/lodash/lodash.min.js')
.pipe(gulp.dest('./cordova/www/lodash.min.js'));
gulp.src('./lib/sqlite.js')
.pipe(gulp.dest('./cordova/www/sqlite.js'));
gulp.src('./spec/test.js')
.pipe(gulp.dest('./cordova/www/test.js'));
gulp.src('./vendor/jasmine-core/lib/jasmine-core/jasmine.css')
.pipe(gulp.dest('./cordova/www/jasmine.css'));
});
gulp.task('watch', function() {
gulp.watch(['src/sqlite.js'], ['build']);
});
gulp.task('default', ['watch', 'server']);