https://github.com/jarweb/nidavel
a tool for building lib wrap by rollup
https://github.com/jarweb/nidavel
library rollup typescript
Last synced: about 2 months ago
JSON representation
a tool for building lib wrap by rollup
- Host: GitHub
- URL: https://github.com/jarweb/nidavel
- Owner: Jarweb
- Created: 2020-03-31T03:40:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T18:01:15.000Z (over 3 years ago)
- Last Synced: 2025-03-18T03:48:57.483Z (over 1 year ago)
- Topics: library, rollup, typescript
- Language: TypeScript
- Homepage:
- Size: 2.55 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nidavel is a planet
## 特性:
- 支持 cjs、umd、esm
- 默认支持 ts
- 默认支持 eslint。需要手动添加 .eslintrc.json 文件
- 默认通过 bable + preset-typeScript 进行编译
- 集成 babel react 优化插件和 esnext 实验性插件
- 默认入口 src/index.ts, 默认输出目录 dist
- 默认不进行代码压缩
- 默认打包不会添加 polyfill,建议在应用打包中进行 polyfill,以避免 polyfill 重复
## 使用:
```code
import configRollup from 'nidavel'
// simple
export default configRollup(options)
// overrides
export defualt configRollup(options, (config) => {
return {
...config,
...{
// overrides
}
}
})
```
## 配置:
```code
type Target = 'cjs' | 'esm' | 'umd'
interface Options {
target: Target[],
globals?: {[key: string]: string}, // 外部引入的依赖
input?: string, // 入口,default src/index.ts
external?: string[], // 排除打包的库
alias?: { [key: string]: string },
isTypescript?: boolean, // default true
minify?: boolean, // default false
filesize?: boolean, // default true
eslintOptions?: any,
replaceOptions?: any
}
interface OptionsOverrideCallback {
(config: RollupOptions): RollupOptions
}
```