Skip to content

Commit

Permalink
feat: add swc replace babel
Browse files Browse the repository at this point in the history
  • Loading branch information
AmbitionsXXXV committed Nov 21, 2023
1 parent e690cd5 commit c0c8021
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 28 deletions.
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const gulp = require('gulp')
const babel = require('gulp-babel')
const ts = require('gulp-typescript')
const del = require('del')
const swc = require('gulp-swc')

// step 1: 如果有对应的产物,此时需要删除 umd cjs esm
gulp.task('clean', async () => {
Expand Down Expand Up @@ -33,7 +34,7 @@ gulp.task('es', () => {
module: 'ESNext',
})

return tsProject.src().pipe(tsProject()).pipe(babel()).pipe(gulp.dest('es/'))
return tsProject.src().pipe(tsProject()).pipe(swc()).pipe(gulp.dest('es/'))
})

// 使用 TypeScript 编译配置文件 tsconfig.pro.json 中指定的 TypeScript 文件,并生成声明文件,然后将它们复制到 es 和 lib 目录下
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"gray-matter": "^4.0.3",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-swc": "^1.3.2",
"gulp-typescript": "^6.0.0-alpha.1",
"husky": "^8.0.0",
"jest": "^29.4.1",
Expand Down
85 changes: 58 additions & 27 deletions pnpm-lock.yaml

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

0 comments on commit c0c8021

Please sign in to comment.