0
点赞
收藏
分享

微信扫一扫

tsup 简单快速的typescript库打包工具

tsup 是一个很不错的工具,可以方便的进行typescript 应用打包以及构建,支持了灵活的资源加载处理
tsx 也是一个不错的工具,可以进行dev 模式的处理

tsup 参考配置

tsup.config.js

import { defineConfig } from 'tsup'
 
export default defineConfig({
  entry: ['src/index.ts'],
  splitting: false,
  sourcemap: true,
  clean: true,
  minify: false,
  format:["cjs","esm","iife"]
})

 

import { defineConfig } from 'tsup'

可以看出特性还是不少的,还是很强大的

说明

tsup 实际上是一个不错的typescript 打包工具,之后我们就不需要依赖npm包了,以前有介绍过ncc 以及pkg ,tsup 也是一个不错工具

参考资料

https://github.com/egoist/tsup
https://tsup.egoist.dev/
https://github.com/esbuild-kit/tsx

举报

相关推荐

0 条评论