9 Star 62 Fork 25

XE/vxe-table-plugin-element

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
gulpfile.js 2.19 KB
一键复制 编辑 原始数据 按行查看 历史
xuliangzhan 提交于 2024-04-30 10:53 . fix
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 dartSass = require('sass')
const gulpSass = require('gulp-sass')
const sass = gulpSass(dartSass)
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 = 'VXETablePluginElement'
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',
dayjs: 'dayjs'
},
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'))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/x-extends/vxe-table-plugin-element.git
git@gitee.com:x-extends/vxe-table-plugin-element.git
x-extends
vxe-table-plugin-element
vxe-table-plugin-element
master

搜索帮助