1 Star 0 Fork 3

前端/companyWeb

forked from 华亿创新/companyWeb 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
gulpfile.js 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
陈非 提交于 2020-06-09 19:54 +08:00 . 修改联系人
var gulp = require('gulp');
var uglify = require("gulp-uglify");
var htmlminify = require('gulp-html-minify');
var imagemin = require('gulp-imagemin');
var csso = require('gulp-csso');
var babel = require('gulp-babel')
gulp.task('js', function () {
return gulp.src('./js/*.js')
.pipe(babel({
presets: ['es2015'] // es5检查机制
}))
.pipe(uglify())
.on('error', function (err) {
gutil.log(gutil.colors.red('[Error]'), err.toString());
})
.pipe(gulp.dest('./dist/js'))
});
gulp.task('css', function () {
return gulp.src('./css/*.css')
.pipe(csso())
.pipe(gulp.dest('./dist/css'))
});
gulp.task('html', function () {
return gulp.src('index.html')
.pipe(htmlminify())
.pipe(gulp.dest('./dist'))
});
gulp.task('html1', function () {
return gulp.src('./html/*.html')
.pipe(htmlminify())
.pipe(gulp.dest('./dist/html'))
});
gulp.task('img', function () {
return gulp.src('./image/*.{jpg,png,gif,ico,svg}')
.pipe(imagemin())
.pipe(gulp.dest('./dist/image'))//不压缩
});
gulp.task('default', gulp.series([
'js',
'css',
'html',
'html1',
'img',
], function () {
console.log('压缩完成');
}));
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/front-end-web-79921018/companyWeb.git
git@gitee.com:front-end-web-79921018/companyWeb.git
front-end-web-79921018
companyWeb
companyWeb
master

搜索帮助