forked from egoist/tsup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.json
352 lines (351 loc) · 9.68 KB
/
schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "tsup",
"version": 1.1,
"anyOf": [
{
"type": "object",
"required": ["tsup"],
"additionalProperties": true,
"properties": {
"tsup": {
"type": ["object", "array"],
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"$ref": "#/definitions/options"
},
{
"type": "array",
"items": {
"additionalProperties": false,
"$ref": "#/definitions/options"
}
}
]
}
}
},
{
"type": ["object", "array"],
"oneOf": [
{
"type": "object",
"$ref": "#/definitions/options"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/options"
}
}
]
}
],
"definitions": {
"options": {
"type": "object",
"markdownDescription": "Configuration options for [tsup](https://tsup.egoist.dev)",
"properties": {
"entry": {
"markdownDescription": "Files that each serve as an input to the bundling algorithm.\n\n---\nReferences:\n- [Entry Points](https://esbuild.github.io/api/#entry-points) - esbuild\n - [Multiple Entrypoints](https://tsup.egoist.sh/#multiple-entrypoints) - tsup",
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "object"
}
]
},
"treeshake": {
"markdownDescription": "By default esbuild already does treeshaking but this option allow you to perform additional treeshaking with Rollup and result in smaller bundle size.",
"oneOf": [
{
"type": "boolean"
},
{
"type": "string",
"enum": ["smallest", "safest", "recommended"]
}
]
},
"name": {
"type": "string",
"description": "Optional config name to show in CLI output"
},
"legacyOutput": {
"type": "boolean",
"description": "Output different formats to different folder instead of using different extension"
},
"target": {
"markdownDescription": "This sets the target environment for the generated code\n\n---\nReferences:\n- [Target](https://esbuild.github.io/api/#target) - esbuild",
"default": "node14",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"minify": {
"type": "boolean",
"description": "When enabled, the generated code will be minified instead of pretty-printed."
},
"minifyWhitespace": {
"type": "boolean"
},
"minifyIdentifiers": {
"type": "boolean"
},
"minifySyntax": {
"type": "boolean"
},
"keepNames": {
"type": "boolean"
},
"watch": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "string",
"items": {
"type": "string"
}
},
{
"type": "array",
"items": {
"type": ["string", "boolean"]
}
}
]
},
"ignoreWatch": {
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"onSuccess": {
"type": "string"
},
"jsxFactory": {
"type": "string"
},
"jsxFragment": {
"type": "string"
},
"outDir": {
"type": "string"
},
"format": {
"oneOf": [
{
"enum": ["cjs", "iife", "esm"],
"type": "string"
},
{
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"enum": ["cjs", "iife", "esm"]
}
}
]
},
"globalName": {
"type": "string"
},
"env": {
"type": "object"
},
"define": {
"type": "object"
},
"dts": {
"markdownDescription": "This will emit `./dist/index.js` and `./dist/index.d.ts`.\n\nIf you have multiple entry files, each entry will get a corresponding `.d.ts` file. So when you only want to generate declaration file for a single entry, use `--dts <entry>` format, e.g. `--dts src/index.ts`.\n\n**Note** that `--dts` does not resolve external (aka in node_modules) types used in the `.d.ts file`, if that's somehow a requirement, try the experimental `--dts-resolve` flag instead.",
"oneOf": [
{
"type": "boolean"
},
{
"type": "string"
},
{
"type": "object",
"properties": {
"entry": {
"oneOf": [
{
"type": "string"
},
{
"type": "object"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
}
}
]
},
"sourcemap": {
"oneOf": [
{
"type": "boolean"
},
{
"enum": ["inline"]
}
]
},
"noExternal": {
"type": "array",
"items": {
"type": "string"
},
"description": "Always bundle modules matching given patterns"
},
"external": {
"description": "Don't bundle these modules",
"type": "array",
"items": {
"type": "string"
}
},
"replaceNodeEnv": {
"type": "boolean",
"markdownDescription": "Replace `process.env.NODE_ENV` with `production` or `development` `production` when the bundled is minified, `development` otherwise"
},
"splitting": {
"type": "boolean",
"default": true,
"markdownDescription": "You may want to disable code splitting sometimes: [`#255`](https://github.com/egoist/tsup/issues/255)"
},
"clean": {
"description": "Clean output directory before each buil",
"oneOf": [
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"silent": {
"type": "boolean",
"description": "Suppress non-error logs (excluding \"onSuccess\" process output)"
},
"skipNodeModulesBundle": {
"type": "boolean",
"description": "Skip node_modules bundling"
},
"pure": {
"markdownDescription": "See:\n- [Pure](https://esbuild.github.io/api/#pure) - esbuild",
"oneOf": [
{
"type": "boolean"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"bundle": {
"default": true,
"type": "boolean",
"description": "Disable bundling, default to true"
},
"inject": {
"markdownDescription": "This option allows you to automatically replace a global variable with an import from another file.\n\n---\nSee:\n- [Inject](https://esbuild.github.io/api/#inject) - esbuild",
"type": "array",
"items": {
"type": "string"
}
},
"metafile": {
"type": "boolean",
"markdownDescription": "Emit esbuild metafile.\n\n---\nSee:\n- [Metafile](https://esbuild.github.io/api/#metafile) - esbuild"
},
"footer": {
"type": "object",
"properties": {
"js": {
"type": "string"
},
"css": {
"type": "string"
}
}
},
"banner": {
"type": "object",
"properties": {
"js": {
"type": "string"
},
"css": {
"type": "string"
}
}
},
"platform": {
"description": "Target platform",
"type": "string",
"default": "node",
"enum": ["node", "browser"]
},
"config": {
"markdownDescription": "Disable config file with `false` or pass a custom config filename",
"type": ["boolean", "string"]
},
"tsconfig": {
"type": "string",
"description": " Use a custom tsconfig"
},
"injectStyle": {
"type": "boolean",
"default": false,
"description": "Inject CSS as style tags to document head"
},
"shims": {
"type": "boolean",
"default": false,
"description": "Inject cjs and esm shims if needed"
}
}
}
}
}