2024-10-09 17:02:34 +00:00
|
|
|
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;
|
2024-10-09 17:02:35 +00:00
|
|
|
path.basename = path.basename.split('-')[0].trim();
|
2024-10-09 17:02:34 +00:00
|
|
|
})
|
|
|
|
)
|
|
|
|
.pipe(gulp.dest('build'));
|
|
|
|
});
|