https://github.com/alpheusday/tsdown
A shareable tsdown configuration
https://github.com/alpheusday/tsdown
config javascript shareable tsdown typescript
Last synced: 3 months ago
JSON representation
A shareable tsdown configuration
- Host: GitHub
- URL: https://github.com/alpheusday/tsdown
- Owner: alpheusday
- License: mit
- Created: 2025-12-04T11:59:53.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-03-13T00:12:15.000Z (3 months ago)
- Last Synced: 2026-03-13T07:39:09.472Z (3 months ago)
- Topics: config, javascript, shareable, tsdown, typescript
- Language: TypeScript
- Homepage: https://github.com/alpheusday/tsdown/blob/main/apis/README.md
- Size: 452 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Alpheus tsdown Configuration
A shareable tsdown configuration.
## Installation
Install this package as a dependency in the project:
```sh
# npm
npm i @apst/tsdown
# Yarn
yarn add @apst/tsdown
# pnpm
pnpm add @apst/tsdown
# Bun
bun add @apst/tsdown
```
## Usage
Implement the preset into `tsdown.config.ts`:
```ts
import { defineConfig } from "@apst/tsdown";
import {
esmPreset,
cjsPreset,
dtsPreset,
} from "@apst/tsdown/presets";
export default defineConfig(
{
entry: {
index: "./src/index.ts",
},
},
[
esmPreset(),
cjsPreset(),
dtsPreset(),
],
);
```
With IIFE output:
```ts
import type { UserConfig } from "tsdown";
import { defineConfig } from "@apst/tsdown";
import {
esmPreset,
cjsPreset,
dtsPreset,
iifePreset,
} from "@apst/tsdown/presets";
const options: UserConfig = {
entry: {
index: "./src/index.ts",
},
};
const iifeOptions: UserConfig = {
entry: {
init: "./src/init.ts",
},
deps: {
alwaysBundle: [
/** ... */
],
},
};
export default defineConfig([
esmPreset(options),
cjsPreset(options),
dtsPreset(options),
iifePreset(iifeOptions),
]);
```
## APIs
For the APIs, please refer to the [APIs](./apis/README.md).
## License
This project is licensed under the terms of the MIT license.