当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 923

qijunbo/vxe-table
暂停

forked from xuliangzhan/vxe-table 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gulpfile.js 2.25 KB
一键复制 编辑 原始数据 按行查看 历史
xuliangzhan 提交于 2019-09-22 23:08 . update
const gulp = require('gulp')
const babel = require('gulp-babel')
const uglify = require('gulp-uglify')
const rename = require('gulp-rename')
const replace = require('gulp-replace')
const clean = require('gulp-clean')
const sass = require('gulp-sass')
const cleanCSS = require('gulp-clean-css')
const prefixer = require('gulp-autoprefixer')
const components = [
'icon',
'table',
'column',
'cell',
'header',
'body',
'footer',
'filter',
'loading',
'menu',
'toolbar',
'grid',
'pager',
'checkbox',
'radio',
'input',
'button',
'modal',
'tooltip',
'edit',
'export',
'keyboard',
'validator',
'resize',
'v-x-e-table'
]
gulp.task('build_modules', () => {
return gulp.src('packages/**/*.js')
.pipe(babel({
presets: ['@babel/env']
}))
.pipe(gulp.dest('lib'))
.pipe(uglify())
.pipe(rename({
suffix: '.min',
extname: '.js'
}))
.pipe(gulp.dest('lib'))
})
gulp.task('copy_ts', () => {
return gulp.src('packages/**/*.d.ts')
.pipe(gulp.dest('lib'))
})
gulp.task('lib_rename', () => {
return Promise.all([
gulp.src('lib/index.umd.js')
.pipe(rename({
basename: 'index',
extname: '.js'
}))
.pipe(gulp.dest('lib')),
gulp.src('lib/index.umd.min.js')
.pipe(rename({
basename: 'index',
suffix: '.min',
extname: '.js'
}))
.pipe(gulp.dest('lib'))
])
})
gulp.task('build_style', gulp.series('build_modules', 'copy_ts', () => {
return Promise.all(components.map(name => {
Promise.all([
gulp.src('styles/index.js')
.pipe(gulp.dest(`lib/${name}/style`)),
gulp.src(`styles/${name}.scss`)
.pipe(replace(/(\/\*\*Variable\*\*\/)/, `@import './variable.scss';\n`))
.pipe(sass())
.pipe(prefixer({
borwsers: ['last 1 version', '> 1%', 'not ie <= 8'],
cascade: true,
remove: true
}))
.pipe(cleanCSS())
.pipe(rename({
basename: 'style',
extname: '.css'
}))
.pipe(gulp.dest(`lib/${name}/style`))
])
}))
}))
gulp.task('build_clean', gulp.series('build_style', 'lib_rename', () => {
return gulp.src([
'lib/demo.html'
])
.pipe(clean())
}))
gulp.task('build', gulp.parallel('build_clean'))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/qijunbo/vxe-table.git
git@gitee.com:qijunbo/vxe-table.git
qijunbo
vxe-table
vxe-table
master

搜索帮助