2017-06-03 04:31:51 +08:00
|
|
|
var ts = require('gulp-typescript');
|
|
|
|
var gulp = require('gulp');
|
2017-06-03 05:21:05 +08:00
|
|
|
var zip = require('gulp-zip');
|
2017-06-03 04:31:51 +08:00
|
|
|
var runSequence = require('run-sequence');
|
|
|
|
|
2017-06-03 05:48:46 +08:00
|
|
|
var tsProject = ts.createProject('tsconfig.json');
|
2017-06-03 04:31:51 +08:00
|
|
|
gulp.task('compile-release', function () {
|
2017-06-03 05:48:46 +08:00
|
|
|
return gulp.src([
|
|
|
|
"frontend/**/*.ts",
|
|
|
|
"common/**/*.ts",
|
|
|
|
"backend/**/*.ts"], {base: "."})
|
|
|
|
.pipe(tsProject())
|
|
|
|
.js
|
|
|
|
.pipe(gulp.dest("."))
|
2017-06-03 04:31:51 +08:00
|
|
|
|
|
|
|
});
|
2017-06-03 05:21:05 +08:00
|
|
|
gulp.task('zip-release', function () {
|
2017-06-03 05:48:46 +08:00
|
|
|
return gulp.src(['package.json',
|
|
|
|
"README.md",
|
|
|
|
"LICENSE",
|
|
|
|
"frontend/**/*.js",
|
|
|
|
"common/**/*.js",
|
|
|
|
"backend/**/*.js",
|
|
|
|
"frontend/**/*.+(png|ejs|html|css)",
|
|
|
|
"frontend/systemjs*"], {base: "."})
|
2017-06-03 05:21:05 +08:00
|
|
|
.pipe(zip('pigallery2.zip'))
|
2017-06-03 05:48:46 +08:00
|
|
|
.pipe(gulp.dest('.'));
|
2017-06-03 05:21:05 +08:00
|
|
|
});
|
2017-06-03 04:31:51 +08:00
|
|
|
|
|
|
|
gulp.task('build-release', function (done) {
|
2017-06-03 05:48:46 +08:00
|
|
|
runSequence('compile-release', 'zip-release', function () {
|
2017-06-03 04:31:51 +08:00
|
|
|
console.log('Run something else');
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|