Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egoist/yaup
unopinionated esbuild cli.
https://github.com/egoist/yaup
Last synced: 22 days ago
JSON representation
unopinionated esbuild cli.
- Host: GitHub
- URL: https://github.com/egoist/yaup
- Owner: egoist
- License: mit
- Created: 2021-06-23T05:49:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-25T14:06:33.000Z (almost 3 years ago)
- Last Synced: 2024-10-04T11:35:43.363Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 305 KB
- Stars: 76
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - yaup
README
**💛 You can help the author become a full-time open-source maintainer by [sponsoring him on GitHub](https://github.com/sponsors/egoist).**
---
# yaup
[![npm version](https://badgen.net/npm/v/yaup)](https://npm.im/yaup)
## Why this over other esbuild/rollup wrappers?
- Unopinionated: close to raw esbuild, flexible configration
- Minimal: minimal API interface so it's easier to maintain## Install
```bash
npm i yaup -D
```## Usage
It's common to publish dual CommonJS/ES module packages with an extra TypeScript declaration file, all you need is creating a `yaup.config.ts`:
```ts
import { defineConfig } from 'yaup'export default defineConfig({
input: './src/index.ts',
output: [
{
format: 'esm',
dir: 'dist/esm',
},
{
format: 'cjs',
dir: 'dist/cjs',
},
{
format: 'dts',
dir: 'dist/types',
},
],
})
```Run `yaup` in this directory, it will emit:
- `dist/esm/index.js`
- `dist/cjs/index.js`
- `dist/types/index.d.ts`Then, configure `package.json` accordingly:
```json
{
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/types/index.js",
"exports": {
".": {
"import": "./dist/esm/index.js",
"default": "./dist/cjs/index.js"
}
}
}
```## API
[Full config reference](./src/config.ts).
## Contributing
Bug fixes are welcome, I'm not accepting new features unless it's absolutely necessary.
## License
MIT © [EGOIST](https://github.com/sponsors/egoist)