remove dist on install and make most tasks run in parrallel

This commit is contained in:
Scott Gould 2024-09-20 00:04:07 -04:00
parent 30b6851f24
commit 6f51acd667
No known key found for this signature in database
2 changed files with 11 additions and 1 deletions

View file

@ -3,6 +3,7 @@ const ts = require("gulp-typescript");
const swc = require("gulp-swc"); const swc = require("gulp-swc");
const tsProject = ts.createProject("tsconfig.json"); const tsProject = ts.createProject("tsconfig.json");
const argv = require("yargs").argv; const argv = require("yargs").argv;
const rimraf = require("rimraf");
const swcOptions = { const swcOptions = {
jsc: { jsc: {
@ -33,6 +34,11 @@ const swcOptions = {
minify: false, minify: false,
}; };
// Clean task to delete the dist directory
gulp.task("clean", () => {
return rimraf.rimraf("dist");
});
// Task to compile TypeScript files using SWC // Task to compile TypeScript files using SWC
gulp.task("scripts", () => { gulp.task("scripts", () => {
if (argv.swc) { if (argv.swc) {
@ -70,4 +76,7 @@ gulp.task("copy-assets", () => {
}); });
// Default task to run all tasks // Default task to run all tasks
gulp.task("default", gulp.series("scripts", "copy-html", "copy-assets")); gulp.task(
"default",
gulp.series("clean", gulp.parallel("scripts", "copy-html", "copy-assets"))
);

View file

@ -22,6 +22,7 @@
"express": "^4.19.2", "express": "^4.19.2",
"gulp-swc": "^2.2.0", "gulp-swc": "^2.2.0",
"node-fetch": "^3.3.2", "node-fetch": "^3.3.2",
"rimraf": "^6.0.1",
"ts-to-jsdoc": "^2.2.0" "ts-to-jsdoc": "^2.2.0"
}, },
"devDependencies": { "devDependencies": {