gyfwj
v1.0.1
Published
```js // //第一步引入 // //引入压缩 // const htmlminify = require("gulp-html-minify"); // const gulp = require("gulp"); // console.log(gulp)
Downloads
1
Readme
// //第一步引入
// //引入压缩
// const htmlminify = require("gulp-html-minify");
// const gulp = require("gulp");
// console.log(gulp)
// //新建的一个任务
// gulp.task("build-css", () => {
// //读取
// return gulp.src("src/css.index.css")
// //压缩html
// .pipe(cssminify())
// //写入
// .pipe(gulp.dest("list/css"))
// })
const {src,dest, watch, series} = require("gulp")
function auto(){
watch("src/index.html",series([buildHtml]))
}
const htmlminify = require("gulp-html-minify");
gulp.task('build-html' , function(){
return gulp.src("src/css/index.html/**/*.html")
.pipe(htmlminify())
.pipe(gulp.dest("/html"))
});
function buildHtml(){
return gulp.src("src/css/index.html")
.pipe(gulp.dest("dist"))
}
function buildScss(){
return src("src/scss*.scss")
.pipe(sass())
.pipe(cleanCss())
.pipe(dest("dest"))
}
function buildJS(){
return gulp.src("src/js*.js").pipe(babel({
"presets":["@babal/env"]
}))
.pipe(uglify)
.pipe(dest("dist"))
}
function build(){
return series(buildHtml,buildJS,buildScss)
}
module.exports = {
buildHtml,
buildScss,
buildJS,
build,
auto,
}