@vitus-labs/tools-rolldown 1.9.1-alpha.1 → 1.9.1-alpha.11
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/README.md +89 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# @vitus-labs/tools-rolldown
|
|
2
|
+
|
|
3
|
+
[Rolldown](https://rolldown.rs)-powered build tool for TypeScript libraries.
|
|
4
|
+
|
|
5
|
+
A fast, Rust-based alternative to `@vitus-labs/tools-rollup`.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun add -d @vitus-labs/tools-rolldown
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Add to your `package.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "vl_rolldown_build",
|
|
21
|
+
"dev": "vl_rolldown_build-watch"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## How it works
|
|
27
|
+
|
|
28
|
+
The build tool reads your `package.json` to determine what output bundles to produce:
|
|
29
|
+
|
|
30
|
+
| `package.json` field | Format | Platform |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| `exports.import` | ESM | universal |
|
|
33
|
+
| `exports.require` | CJS | universal |
|
|
34
|
+
| `main` | CJS or ESM | universal |
|
|
35
|
+
| `module` | ESM | universal |
|
|
36
|
+
| `browser` | same as source | browser |
|
|
37
|
+
| `react-native` | ESM | native |
|
|
38
|
+
| `umd:main` | UMD | — |
|
|
39
|
+
| `unpkg` | UMD (minified) | — |
|
|
40
|
+
|
|
41
|
+
TypeScript declarations are generated automatically when `exports.types` (or `types`/`typings`) is set.
|
|
42
|
+
|
|
43
|
+
### Platform globals
|
|
44
|
+
|
|
45
|
+
These constants are injected at build time based on the output platform:
|
|
46
|
+
|
|
47
|
+
| Constant | Description |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `__VERSION__` | Package version from `package.json` |
|
|
50
|
+
| `__BROWSER__` | `true` for browser builds |
|
|
51
|
+
| `__NODE__` | `true` for node builds |
|
|
52
|
+
| `__WEB__` | `true` for node + browser + universal |
|
|
53
|
+
| `__NATIVE__` | `true` for React Native builds |
|
|
54
|
+
| `__CLIENT__` | `true` for browser + native |
|
|
55
|
+
|
|
56
|
+
Add type declarations to your project:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"compilerOptions": {
|
|
61
|
+
"types": ["@vitus-labs/tools-rolldown/global"]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Configuration
|
|
67
|
+
|
|
68
|
+
Configure via `vl-tools.config.mjs` (key: `build`):
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
export default {
|
|
72
|
+
build: {
|
|
73
|
+
sourceDir: 'src',
|
|
74
|
+
outputDir: 'lib',
|
|
75
|
+
typescript: true,
|
|
76
|
+
esModulesOnly: false,
|
|
77
|
+
replaceGlobals: true,
|
|
78
|
+
external: ['react/jsx-runtime'],
|
|
79
|
+
globals: {
|
|
80
|
+
react: 'React',
|
|
81
|
+
'react-dom': 'ReactDOM',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitus-labs/tools-rolldown",
|
|
3
|
-
"version": "1.9.1-alpha.
|
|
3
|
+
"version": "1.9.1-alpha.11+60255d1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@vitus-labs/tools-core": "1.9.1-alpha.
|
|
40
|
+
"@vitus-labs/tools-core": "1.9.1-alpha.11+60255d1",
|
|
41
41
|
"chalk": "^5.6.2",
|
|
42
42
|
"rimraf": "^6.1.3",
|
|
43
43
|
"rolldown": "^1.0.0-rc.5",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"rollup-plugin-visualizer": "^7.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@vitus-labs/tools-typescript": "1.9.1-alpha.
|
|
49
|
+
"@vitus-labs/tools-typescript": "1.9.1-alpha.11+60255d1",
|
|
50
50
|
"typescript": "^5.9.3"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "60255d1e0f077704603a45844643ff823439dd0c"
|
|
53
53
|
}
|