You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
751 B
JavaScript
28 lines
751 B
JavaScript
const {src, dest, watch, series, task} = require('gulp');
|
|
const ts = require('gulp-typescript');
|
|
const del = require('delete');
|
|
const gulp = require('gulp');
|
|
|
|
function clearDist(cb) {
|
|
del('dist/*', cb);
|
|
}
|
|
|
|
function compileTypescript() {
|
|
let tsProject = ts.createProject('tsconfig.json');
|
|
let tsResult = tsProject.src().pipe(tsProject());
|
|
return tsResult
|
|
.pipe(dest('dist'));
|
|
}
|
|
|
|
function moveRemaining() {
|
|
return src(['src/**/*', '!src/**/*.ts', '!src/**/*.sass', '!src/**/*.js'])
|
|
.pipe(dest('dist'));
|
|
}
|
|
|
|
task('default', series(clearDist, compileTypescript, moveRemaining));
|
|
task('watch', () => {
|
|
watch('src/public/stylesheets/sass/**/*.sass');
|
|
watch('**/*.js');
|
|
watch('**/*.ts', compileTypescript);
|
|
});
|