Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Sep 28, 2019
1 parent db648d1 commit cd67320
Show file tree
Hide file tree
Showing 10 changed files with 301 additions and 305 deletions.
4 changes: 4 additions & 0 deletions depend.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import XEUtils from 'xe-utils/methods/xe-utils'
import dependencies from 'vxe-table/lib/utils/dependencies'

XEUtils.mixin(dependencies)
211 changes: 100 additions & 111 deletions dist/index.common.js

Large diffs are not rendered by default.

217 changes: 103 additions & 114 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 21 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
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 exportModuleName = 'VXETablePluginIView'
Expand All @@ -27,20 +30,28 @@ gulp.task('build_style', function () {
})

gulp.task('build_commonjs', function () {
return gulp.src('index.js')
return gulp.src(['depend.ts', 'index.ts'])
.pipe(sourcemaps.init())
.pipe(ts({
noImplicitAny: true
}))
.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.js')
.pipe(replace(`from 'xe-utils/methods/xe-utils'`, `from 'xe-utils'`))
return gulp.src(['depend.ts', 'index.ts'])
.pipe(ts({
noImplicitAny: true
}))
.pipe(replace(`require("xe-utils/methods/xe-utils")`, `require("xe-utils")`))
.pipe(babel({
moduleId: pack.name,
presets: ['@babel/env'],
Expand All @@ -61,4 +72,10 @@ gulp.task('build_umd', function () {
.pipe(gulp.dest('dist'))
})

gulp.task('build', gulp.parallel('build_style', 'build_commonjs', 'build_umd'))
gulp.task('clear', () => {
return del([
'dist/depend.*'
])
})

gulp.task('build', gulp.series(gulp.parallel('build_commonjs', 'build_umd', 'build_style'), 'clear'))
12 changes: 0 additions & 12 deletions index.d.ts

This file was deleted.

Loading

0 comments on commit cd67320

Please sign in to comment.