2 Star 0 Fork 0

keman5/feeltimes

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
gulpfile.js 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
dazeng 提交于 2020-01-21 09:52 . 压缩图片
const { src, task, dest, parallel } = require('gulp')
const babel = require('gulp-babel')
const uglify = require('gulp-uglify')
const imagemin = require('gulp-imagemin')
// 加载dotenv模块
// 具体用法可以查看文档
require('dotenv').config()
// console.log(process.env)
const sourceFiles = ['./assets/libs/*.*']
const Copy = cb => {
src(sourceFiles).pipe(dest('./dist/m/libs'))
cb()
}
task(Copy)
const mCss = cb => {
src(['./assets/css/*.css']).pipe(dest('./dist/m/css'))
cb()
}
task(mCss)
const mJs = cb => {
src(['./assets/js/*.js', './assets/js/**/*.js'])
.pipe(
babel({
presets: ['@babel/preset-env']
})
)
.pipe(uglify())
.pipe(dest('./dist/m/js'))
cb()
}
task(mJs)
const mImg = cb => {
src('./assets/img/**/*')
.pipe(
imagemin([
imagemin.gifsicle({ interlaced: true }),
imagemin.mozjpeg({ quality: 75, progressive: true }),
imagemin.optipng({ optimizationLevel: 5 }),
imagemin.svgo({
plugins: [{ removeViewBox: true }, { cleanupIDs: false }]
})
])
)
.pipe(dest('./dist/m/img'))
cb()
}
task(mImg)
exports.buildImg = mImg
exports.build = parallel(Copy, mCss, mJs, mImg)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/keman5/feeltimes.git
[email protected]:keman5/feeltimes.git
keman5
feeltimes
feeltimes
master

搜索帮助