the-honk/euler/gulpfile.js
2024-10-09 18:02:35 +01:00

20 lines
593 B
JavaScript

const gulp = require('gulp');
const typescript = require('gulp-typescript');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
gulp.task('build', () => {
const tsc = typescript.createProject('tsconfig.json');
return gulp
.src('src/**/*.ts')
.pipe(tsc())
.pipe(uglify({ mangle: { toplevel: true } }))
.pipe(
rename(path => {
if (path.basename === 'utils') return;
path.basename = path.basename.split('-')[0].trim();
})
)
.pipe(gulp.dest('build'));
});