1 Star 0 Fork 12

凡尘/vxe-table-plugin-antd

forked from XE/vxe-table-plugin-antd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gulpfile.js 2.08 KB
一键复制 编辑 原始数据 按行查看 历史
xuliangzhan 提交于 2021-04-22 17:21 . update
const gulp = require('gulp')
const del = require('del')
const uglify = require('gulp-uglify')
const babel = require('gulp-babel')
const rename = require('gulp-rename')
const replace = require('gulp-replace')
const sass = require('gulp-sass')
const cleanCSS = require('gulp-clean-css')
const prefixer = require('gulp-autoprefixer')
const sourcemaps = require('gulp-sourcemaps')
const ts = require('gulp-typescript')
const pack = require('./package.json')
const tsconfig = require('./tsconfig.json')
const exportModuleName = 'VXETablePluginAntd'
gulp.task('build_style', function () {
return gulp.src('style.scss')
.pipe(sass())
.pipe(prefixer({
borwsers: ['last 1 version', '> 1%', 'not ie <= 8'],
cascade: true,
remove: true
}))
.pipe(gulp.dest('dist'))
.pipe(cleanCSS())
.pipe(rename({
extname: '.min.css'
}))
.pipe(gulp.dest('dist'))
})
gulp.task('build_commonjs', function () {
return gulp.src(['index.ts'])
.pipe(sourcemaps.init())
.pipe(ts(tsconfig.compilerOptions))
.pipe(babel({
presets: ['@babel/env']
}))
.pipe(rename({
basename: 'index',
extname: '.common.js'
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest('dist'))
})
gulp.task('build_umd', function () {
return gulp.src(['index.ts'])
.pipe(ts(tsconfig.compilerOptions))
.pipe(babel({
moduleId: pack.name,
presets: ['@babel/env'],
plugins: [['@babel/transform-modules-umd', {
globals: {
[pack.name]: exportModuleName,
'vue': 'Vue',
'vxe-table': 'VXETable',
'xe-utils': 'XEUtils'
},
exactGlobals: true
}]]
}))
.pipe(rename({
basename: 'index',
suffix: '.umd',
extname: '.js'
}))
.pipe(gulp.dest('dist'))
.pipe(uglify())
.pipe(rename({
basename: 'index',
suffix: '.umd.min',
extname: '.js'
}))
.pipe(gulp.dest('dist'))
})
gulp.task('clear', () => {
return del([
'dist/depend.*'
])
})
gulp.task('build', gulp.series(gulp.parallel('build_commonjs', 'build_umd', 'build_style'), 'clear'))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/nimrodchen/vxe-table-plugin-antd.git
git@gitee.com:nimrodchen/vxe-table-plugin-antd.git
nimrodchen
vxe-table-plugin-antd
vxe-table-plugin-antd
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385