Files
reference/gulpfile.js
T
FireIsGood ef823489fe fix: format complex changes
Formats all the general js files. Separate in case these should be
treated differently for any reason. This commit includes all javascript
and HTML files.
2024-05-16 14:37:00 -07:00

45 lines
934 B
JavaScript

const gulp = require("gulp");
const htmlmin = require("gulp-htmlmin");
const htmlclean = require("gulp-htmlclean");
const version = require("gulp-version-number");
const terser = require("gulp-terser");
// Compress js files
gulp.task("js", function () {
return gulp
.src(["./public/js/main.js"])
.pipe(
terser({
compress: true,
}),
)
.pipe(gulp.dest("./public/js"));
});
// Build html files
gulp.task("html", function () {
return gulp
.src("./public/**/*.html")
.pipe(htmlclean())
.pipe(
htmlmin({
removeComments: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true,
}),
)
.pipe(
version({
append: {
key: "_v",
cover: 1,
to: ["css", "js", "png", "jpg", "woff2"],
},
}),
)
.pipe(gulp.dest("./public"));
});
gulp.task("default", gulp.parallel("js", "html"));