tsdown-preset 0.0.0-alpha.0.0.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +96 -0
- package/dist/index.d.ts +7480 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6686 -4
- package/dist/index.js.map +1 -1
- package/package.json +54 -58
- package/dist/index-Doy_YMxE.d.ts +0 -5
- package/dist/index-Doy_YMxE.d.ts.map +0 -1
package/LICENSE
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# tsdown-preset
|
|
2
|
+
|
|
3
|
+
> An opinionated preset for tsdown.
|
|
4
|
+
|
|
5
|
+
A configuration preset library for [tsdown](https://github.com/rolldown/tsdown), designed to simplify TypeScript project
|
|
6
|
+
build configuration.
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/tsdown-preset)
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
- 📦 Ready-to-use TypeScript build configuration
|
|
13
|
+
- 🚀 Preset solutions optimized for different scenarios
|
|
14
|
+
- 🔧 Flexible and overridable configuration
|
|
15
|
+
- 🎯 Support for multiple build targets (Vue, CLI, general libraries, etc.)
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm add tsdown-preset -D
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Create a `tsdown.config.ts` file in your project root directory:
|
|
26
|
+
|
|
27
|
+
### General Library Configuration
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { lib } from 'tsdown-preset'
|
|
31
|
+
|
|
32
|
+
export default lib()
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Default configuration:
|
|
36
|
+
|
|
37
|
+
- Entry: `src/**/*.ts`
|
|
38
|
+
- Platform: `neutral`
|
|
39
|
+
- Inherits all configurations from `baseConfig`
|
|
40
|
+
|
|
41
|
+
### Vue Component Library Configuration
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { vue } from 'tsdown-preset'
|
|
45
|
+
|
|
46
|
+
export default vue()
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Default configuration:
|
|
50
|
+
|
|
51
|
+
- Platform: `neutral`
|
|
52
|
+
- fromVite: true
|
|
53
|
+
- Enable Vue type declaration generation
|
|
54
|
+
- Inherits all configurations from `baseConfig`
|
|
55
|
+
|
|
56
|
+
### CLI Tool Configuration
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import { cli } from 'tsdown-preset'
|
|
60
|
+
|
|
61
|
+
export default cli()
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Default configuration:
|
|
65
|
+
|
|
66
|
+
- Entry: `src/cli.ts`
|
|
67
|
+
- Platform: `node`
|
|
68
|
+
- Inherits all configurations from `baseConfig`
|
|
69
|
+
|
|
70
|
+
### Custom Configuration
|
|
71
|
+
|
|
72
|
+
All presets support configuration overrides:
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import { lib } from 'tsdown-preset'
|
|
76
|
+
|
|
77
|
+
export default lib({
|
|
78
|
+
entry: 'src/index.ts',
|
|
79
|
+
platform: 'node',
|
|
80
|
+
// Other tsdown configuration options...
|
|
81
|
+
})
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Preset Documentation
|
|
85
|
+
|
|
86
|
+
### `baseConfig`
|
|
87
|
+
|
|
88
|
+
Base configuration preset, providing common build configurations:
|
|
89
|
+
|
|
90
|
+
- `exports: true` - Generate ES module exports
|
|
91
|
+
- `dts: true` - Generate type declaration files
|
|
92
|
+
- `sourcemap: true` - Generate Source Maps
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
[MIT](LICENSE) © 2025 [lonewolfyx](https://github.com/lonewolfyx)
|