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.
27 lines
721 B
JavaScript
27 lines
721 B
JavaScript
const {src, dest, watch, series, task} = require('gulp');
|
|
const ts = require('gulp-typescript');
|
|
const del = require('delete');
|
|
|
|
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);
|
|
});
|