1 Star 0 Fork 15

isni/vxe-table-plugin-export-xlsx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gulpfile.js 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
xuliangzhan 提交于 2021-03-16 17:47 . 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 sourcemaps = require('gulp-sourcemaps')
const ts = require('gulp-typescript')
const pack = require('./package.json')
const tsconfig = require('./tsconfig.json')
const exportModuleName = 'VXETablePluginExportXLSX'
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,
'vxe-table': 'VXETable',
'xe-utils': 'XEUtils',
'exceljs': 'ExcelJS'
},
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'), 'clear'))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/isni/vxe-table-plugin-export-xlsx.git
git@gitee.com:isni/vxe-table-plugin-export-xlsx.git
isni
vxe-table-plugin-export-xlsx
vxe-table-plugin-export-xlsx
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385