All checks were successful
continuous-integration/drone/push Build is passing
25 lines
669 B
JavaScript
25 lines
669 B
JavaScript
var gulp = require('gulp');
|
|
var ts = require('gulp-typescript');
|
|
var sourcemaps = require('gulp-sourcemaps');
|
|
var gulpif = require('gulp-if');
|
|
var tsProject = ts.createProject('tsconfig.json');
|
|
var del = require('del');
|
|
|
|
builder = function (production = true) {
|
|
return function () {
|
|
return tsProject
|
|
.src()
|
|
.pipe(gulpif(!production, sourcemaps.init()))
|
|
.pipe(tsProject())
|
|
.js.pipe(gulpif(!production, sourcemaps.write()))
|
|
.pipe(gulp.dest('dist'));
|
|
};
|
|
};
|
|
|
|
gulp.task('clean', function () {
|
|
return del('dist');
|
|
});
|
|
|
|
gulp.task('build', builder(false));
|
|
gulp.task('build:prod', builder(true));
|