mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-04 10:34:45 +02:00
43 lines
1.1 KiB
JavaScript
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();
|
||
|
});
|
||
|
});
|