1 Star 0 Fork 40

front7/wordpress-theme-puock

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
gulpfile.js 1.98 KB
一键复制 编辑 原始数据 按行查看 历史
Licoy 提交于 2022-12-15 21:49 . :arrow_up:升级bootstrap版本为5.2
const gulp = require('gulp')
const babel = require('gulp-babel');
const less = require('gulp-less');
const rename = require('gulp-rename');
const uglify = require('gulp-uglify');
const plumber = require('gulp-plumber');
const concat = require('gulp-concat');
const concatCss = require('gulp-concat-css');
const minifyCSS = require('gulp-minify-css')
const _core_script = "assets/js/*.js"
const _libs_script = "assets/libs/basic/**/*.js"
const _core_style = "assets/style/*.less"
const _libs_style = "assets/libs/basic/**/*.css"
const _dist = "assets/dist"
gulp.task('style', function () {
return gulp.src(_core_style)
.pipe(plumber())
.pipe(less({
compress: true
}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(_dist + '/style'))
})
gulp.task('lib_style', function () {
return gulp.src(_libs_style)
.pipe(concatCss("libs.min.css",{
// inlineImports:false,
rebaseUrls:false
}))
.pipe(minifyCSS({
format: 'keep-breaks',
semicolonAfterLastProperty: true,
afterComment: true
}))
.pipe(gulp.dest(_dist + '/style'))
})
gulp.task('lib_script', function () {
return gulp.src(_libs_script)
.pipe(concat("libs.min.js"))
.pipe(uglify({
output: {
comments: true,
}
}))
.pipe(gulp.dest(_dist + '/js'))
})
gulp.task('script', function () {
return gulp.src(_core_script)
.pipe(plumber())
.pipe(rename({suffix: '.min'}))
.pipe(babel())
.pipe(uglify())
.pipe(gulp.dest(_dist + '/js'))
})
gulp.task('build', gulp.series(
'style',
'lib_style',
'script',
'lib_script',
))
gulp.task('watch', gulp.series('build', function () {
gulp.watch(_core_style, gulp.series('style'))
gulp.watch(_core_script, gulp.series('script'))
gulp.watch(_libs_script, gulp.series('lib_script'))
gulp.watch(_libs_style, gulp.series('lib_style'))
}))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/front7/wordpress-theme-puock.git
[email protected]:front7/wordpress-theme-puock.git
front7
wordpress-theme-puock
wordpress-theme-puock
master

搜索帮助