1 Star 0 Fork 0

wangzhefeng2000/reference

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gulpfile.js 934 Bytes
一键复制 编辑 原始数据 按行查看 历史
FireIsGood 提交于 2024-05-16 16:48 +08:00 . fix: format complex changes
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"));
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wangzhefeng2000/reference.git
git@gitee.com:wangzhefeng2000/reference.git
wangzhefeng2000
reference
reference
main

搜索帮助