-
Notifications
You must be signed in to change notification settings - Fork 64
/
gulpfile.js
44 lines (38 loc) · 975 Bytes
/
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
var gulp = require('gulp');
var del = require('del');
var inline = require('gulp-inline-js');
var path = {
libjs: {
src: 'src/runtime/main.js',
release: 'dist/'
},
libplugin: {
src: 'src/server/**/*',
release: 'dist/server'
},
jshelper: {
src: 'src/js_helper/**/*',
release: 'dist/js_helper'
}
};
//compile libjs
gulp.task('libjs:compile', function () {
return gulp.src(path.libjs.src)
.pipe(inline())
.pipe(gulp.dest(path.libjs.release));
});
//copy runtime
gulp.task('libplugin:copy', function () {
gulp.src(path.libplugin.src)
.pipe(gulp.dest(path.libplugin.release));
});
//copy jshelper
gulp.task('js_helper:copy', function () {
return gulp.src(path.jshelper.src)
.pipe(gulp.dest(path.jshelper.release));
});
gulp.task('clean', del.bind(null, 'dist/**'));
gulp.task('compile', ['libjs:compile', 'libplugin:copy', 'js_helper:copy']);
gulp.task('default', ['clean'], function(){
gulp.start('compile');
});