1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/gulpfile.js
2017-06-02 22:31:51 +02:00

43 lines
1.1 KiB
JavaScript

var ts = require('gulp-typescript');
var del = require('del');
var gulp = require('gulp');
var merge = require('merge2');
var runSequence = require('run-sequence');
var tsProject = ts.createProject('tsconfig.json');
gulp.task('clean', function () {
return del('release/');
});
gulp.task("copy-files", function () {
return gulp
.src(['package.json',
".npmignore",
"frontend/**/*.+(png|ejs|html|css)",
"frontend/systemjs*"], {base: "."})
.pipe(gulp.dest("release"));
});
gulp.task('compile-release', function () {
return merge(
['frontend',
'common',
'backend'].map(function (dir) {
var tsProject = ts.createProject('tsconfig.json');
return gulp.src(dir + "/**/*.ts")
.pipe(tsProject())
.js
.pipe(gulp.dest("release/" + dir))
})
);
});
gulp.task('build-release', function (done) {
runSequence('clean', 'copy-files', 'compile-release', function () {
console.log('Run something else');
done();
});
});