chore: build ts / bundle js in series

This commit is contained in:
Oliver Booth 2023-08-10 14:34:01 +01:00
parent fb6eabf55f
commit fa17f63b82
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61

View File

@ -18,11 +18,13 @@ function compileSCSS() {
} }
function compileTS() { function compileTS() {
gulp.src(`${srcDir}/ts/**/*.ts`) return gulp.src(`${srcDir}/ts/**/*.ts`)
.pipe(ts("tsconfig.json")) .pipe(ts("tsconfig.json"))
.pipe(terser()) .pipe(terser())
.pipe(gulp.dest(`tmp/js`)); .pipe(gulp.dest(`tmp/js`));
}
function bundleJS() {
return gulp.src('tmp/js/*.js') return gulp.src('tmp/js/*.js')
.pipe(webpack({ mode: 'production', output: { filename: 'app.min.js' } })) .pipe(webpack({ mode: 'production', output: { filename: 'app.min.js' } }))
.pipe(gulp.dest(`${destDir}/js`)); .pipe(gulp.dest(`${destDir}/js`));
@ -46,4 +48,4 @@ function copyImages() {
} }
exports.default = compileSCSS; exports.default = compileSCSS;
exports.default = gulp.parallel(compileSCSS, compileTS, copyCSS, copyJS, copyImages); exports.default = gulp.parallel(compileSCSS, gulp.series(compileTS, bundleJS), copyCSS, copyJS, copyImages);