Repository navigation
Expand file tree
/
Copy pathschema.json
More file actions
5865 lines (5865 loc) · 280 KB
/
Copy pathschema.json
File metadata and controls
5865 lines (5865 loc) · 280 KB
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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"anyOf": [
{
"type": "object",
"properties": {
"entry": {
"anyOf": [
{ "type": "string" },
{ "$ref": "#/$defs/Record" },
{
"type": "array",
"items": {
"anyOf": [{ "type": "string" }, { "$ref": "#/$defs/Record" }]
}
}
],
"description": "Defaults to `'src/index.ts'` if it exists.\n\nSupports glob patterns with negation to exclude files:",
"default": { "index": "src/index.ts" }
},
"deps": {
"$ref": "#/$defs/DepsConfig",
"description": "Dependency handling options."
},
"alias": { "$ref": "#/$defs/Record_519c04ca" },
"tsconfig": {
"anyOf": [
{ "type": "string" },
{ "const": false },
{ "const": true }
],
"default": true
},
"platform": {
"anyOf": [
{ "const": "node" },
{ "const": "neutral" },
{ "const": "browser" }
],
"description": "Specifies the target runtime platform for the build.\n\n- `node`: Node.js and compatible runtimes (e.g., Deno, Bun).\n For CJS format, this is always set to `node` and cannot be changed.\n- `neutral`: A platform-agnostic target with no specific runtime assumptions.\n- `browser`: Web browsers.",
"default": "node"
},
"target": {
"anyOf": [
{ "type": "string" },
{ "const": false },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Specifies the compilation target environment(s).\n\nDetermines the JavaScript version or runtime(s) for which the code should be compiled.\nIf not set, defaults to the value of `engines.node` in your project's `package.json`.\nIf no `engines.node` field exists, no syntax transformations are applied.\n\nAccepts a single target (e.g., `'es2020'`, `'node18'`, `'baseline-widely-available'`), an array of targets, or `false` to disable all transformations."
},
"env": {
"$ref": "#/$defs/Record_8bd28e51",
"description": "Compile-time env variables, which can be accessed via `import.meta.env` or `process.env`.",
"default": {}
},
"envFile": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Path(s) to env files providing compile-time env variables.\n\nFiles are loaded in order, so later files override earlier ones.\nMissing files are skipped."
},
"envPrefix": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "When loading env variables from `envFile`, only include variables with these prefixes.",
"default": "TSDOWN_"
},
"define": { "$ref": "#/$defs/Record_519c04ca" },
"shims": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Inject CJS `__dirname` and `__filename` shims into ESM output.\nOnly applies when {@linkcode platform} is set to `node`.\n\nNote: `import.meta.url`, `import.meta.dirname`, and `import.meta.filename`\nare always shimmed in CJS output, regardless of this option.",
"default": false
},
"treeshake": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "$ref": "#/$defs/TreeshakingOptions" }
],
"description": "Configure tree shaking options.",
"default": true
},
"loader": {
"$ref": "#/$defs/ModuleTypes",
"description": "Sets how input files are processed.\nFor example, use 'js' to treat files as JavaScript or 'base64' for images.\nLets you import or require files like images or fonts."
},
"nodeProtocol": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "const": "strip" }
],
"description": "Control whether built-in Node.js module imports use the `node:` protocol.\n\n- `true`: Add the `node:` prefix to built-in module imports.\n- `'strip'`: Remove the `node:` prefix from built-in module imports.\n- `false`: Do not transform built-in module imports.",
"default": false
},
"checks": {
"allOf": [
{ "$ref": "#/$defs/ChecksOptions" },
{
"type": "object",
"properties": {
"legacyCjs": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "If the config includes the `cjs` format and\none of its targets is a Node.js version that supports `require(esm)`\n(`^20.19.0 || >=22.12.0`),\nwarn the user about the deprecation of CommonJS.",
"default": true
}
},
"required": [],
"additionalProperties": false
}
],
"description": "Controls which warnings are emitted during the build process. Each option can be set to `true` (emit warning) or `false` (suppress warning)."
},
"inputOptions": {
"$ref": "#/$defs/InputOptions",
"description": "Use with caution; ensure you understand the implications."
},
"format": {
"anyOf": [
{ "const": "es" },
{ "const": "cjs" },
{ "const": "esm" },
{ "const": "module" },
{ "const": "commonjs" },
{ "const": "iife" },
{ "const": "umd" },
{ "type": "array", "items": { "$ref": "#/$defs/ModuleFormat" } },
{ "$ref": "#/$defs/Partial" }
],
"description": "Output format(s). Available formats are\n- `esm`: ESM\n- `cjs`: CommonJS\n- `iife`: IIFE\n- `umd`: UMD",
"default": "esm"
},
"globalName": { "type": "string" },
"outDir": { "type": "string", "default": "dist" },
"write": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to write the files to disk.\nThis option is incompatible with watch mode.",
"default": true
},
"sourcemap": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "const": "inline" },
{ "const": "hidden" }
],
"description": "Whether to generate source map files.\n\nNote that this option will always be `true` if you have\n{@link https://www.typescriptlang.org/tsconfig/#declarationMap `declarationMap`}\noption enabled in your `tsconfig.json`.",
"default": false
},
"clean": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Clean directories before build.\n\nDefault to output directory.",
"default": true
},
"minify": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "const": "dce-only" },
{ "$ref": "#/$defs/MinifyOptions" }
],
"default": "dce-only"
},
"footer": {
"anyOf": [
{ "type": "string" },
{ "$ref": "#/$defs/ChunkAddonObject" }
]
},
"banner": {
"anyOf": [
{ "type": "string" },
{ "$ref": "#/$defs/ChunkAddonObject" }
]
},
"unbundle": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Determines whether `unbundle` is enabled.\nWhen set to `true`, the output files will mirror the input file structure.",
"default": false
},
"root": {
"type": "string",
"description": "Specifies the root directory of input files, similar to TypeScript's `rootDir`.\nThis determines the output directory structure.\n\nBy default, the root is computed as the common base directory of all entry files."
},
"fixedExtension": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Use a fixed extension for output files.\nThe extension will always be `.cjs` or `.mjs`.\nOtherwise, it will depend on the package type.\n\nDefaults to `true` if {@linkcode platform} is set to `node`,\n`false` otherwise."
},
"hash": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "If enabled, appends hash to chunk filenames.",
"default": true
},
"cjsDefault": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Converts a single default export from an explicit CJS entry module to\n`module.exports`. It does not apply to non-entry chunks emitted in\nunbundle mode.",
"default": true
},
"outputOptions": {
"$ref": "#/$defs/OutputOptions",
"description": "Use with caution; ensure you understand the implications."
},
"cwd": {
"type": "string",
"description": "The working directory of the config file.\n- Defaults to {@linkcode process.cwdprocess.cwd()} for root config.\n- Defaults to the package directory for {@linkcode workspace} config."
},
"name": {
"type": "string",
"description": "The name to show in CLI output. This is useful for monorepos or workspaces.\nWhen using workspace mode, this option defaults to the package name from package.json.\nIn non-workspace mode, this option must be set explicitly for the name to show in the CLI output."
},
"logLevel": {
"anyOf": [
{ "const": "info" },
{ "const": "warn" },
{ "const": "silent" },
{ "const": "error" }
],
"description": "Log level.",
"default": "info"
},
"failOnWarn": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "const": "ci-only" },
{ "const": "local-only" }
],
"description": "If true, fails the build on warnings.",
"default": false
},
"suppressWarnings": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Suppress warnings whose message matches the given pattern(s).\n\nAccepts a string (substring match), a `RegExp`, an array of either, or a\npredicate function. Matched warnings are dropped before `failOnWarn` is\napplied, so they won't fail the build."
},
"customLogger": {
"$ref": "#/$defs/Logger",
"description": "Custom logger."
},
"fromVite": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "const": "vitest" }
],
"description": "Reuse config from Vite or Vitest (experimental)",
"default": false
},
"watch": {
"anyOf": [
{ "type": "string" },
{ "const": false },
{ "const": true },
{ "type": "array", "items": { "type": "string" } }
],
"default": false
},
"ignoreWatch": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Files or patterns to not watch while in watch mode."
},
"devtools": {
"$ref": "#/$defs/WithEnabled",
"description": "**[experimental]** Enable devtools.\n\nDevTools is still under development, and this is for early testers only.\n\nThis may slow down the build process significantly.",
"default": false
},
"onSuccess": {
"type": "string",
"description": "You can specify command to be executed after a successful build, specially useful for Watch mode"
},
"dts": {
"$ref": "#/$defs/WithEnabled_12743f1e",
"description": "Enables generation of TypeScript declaration files (`.d.ts`).\n\nBy default, this option is auto-detected:\n- If {@linkcode exe} is enabled, declaration file generation is disabled by default.\n- If the `types` or `typings` field is present in `package.json`, or if its `exports` field contains a `types` entry, declaration file generation is enabled by default.\n- Otherwise, if the resolved `tsconfig.json` has `declaration: true`, declaration file generation is enabled by default.\n- Otherwise, declaration file generation is disabled by default."
},
"unused": {
"$ref": "#/$defs/WithEnabled_12743f1e",
"description": "Enable unused dependencies check with `unplugin-unused`\nRequires `unplugin-unused` to be installed.",
"default": false
},
"publint": {
"$ref": "#/$defs/WithEnabled_2bd75970",
"description": "Run `publint` after bundling.\nRequires `publint` to be installed.",
"default": false
},
"attw": {
"$ref": "#/$defs/WithEnabled_acd1c896",
"description": "Run `arethetypeswrong` after bundling.\nRequires `@arethetypeswrong/core` to be installed.",
"default": false
},
"report": {
"$ref": "#/$defs/WithEnabled_64c49380",
"description": "Enable size reporting after bundling.",
"default": true
},
"globImport": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "`import.meta.glob` support.",
"default": true
},
"exports": {
"$ref": "#/$defs/WithEnabled_444b9595",
"description": "Generate package exports for `package.json`.\n\nThis will set the `exports` field in `package.json` to point to the\ngenerated files.",
"default": false
},
"css": {
"anyOf": [{ "const": false }, { "$ref": "#/$defs/CssOptions" }],
"description": "**[experimental]** CSS options.\nRequires `@tsdown/css` to be installed.\n\nSet to `false` to disable built-in CSS handling, leaving CSS files to\nuser plugins."
},
"copy": {
"anyOf": [
{ "type": "string" },
{ "$ref": "#/$defs/CopyEntry" },
{
"type": "array",
"items": {
"anyOf": [{ "type": "string" }, { "$ref": "#/$defs/CopyEntry" }]
}
}
],
"description": "Copy files to another directory."
},
"hooks": { "$ref": "#/$defs/Partial_6b66b23d" },
"exe": {
"$ref": "#/$defs/WithEnabled_e5683b6a",
"description": "**[experimental]** Bundle as executable using Node.js SEA (Single Executable Applications).\n\nThis will bundle the output into a single executable file using Node.js SEA.\nNote that this is only supported on Node.js 25.7.0 and later, and is not supported in Bun or Deno.",
"default": false
},
"workspace": {
"anyOf": [
{ "type": "string" },
{ "const": true },
{ "type": "array", "items": { "type": "string" } },
{ "$ref": "#/$defs/Workspace" }
],
"description": "**[experimental]** Enable workspace mode.\nThis allows you to build multiple packages in a monorepo."
},
"external": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "$ref": "#/$defs/StringOrRegExp" } }
],
"description": "Cannot be combined with `deps.neverBundle`; setting both throws an error.\n\nDeprecated: Use {@linkcode DepsConfig.neverBundle deps.neverBundle} instead.",
"deprecated": true
},
"noExternal": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Cannot be combined with `deps.alwaysBundle`; setting both throws an error.\n\nDeprecated: Use {@linkcode DepsConfig.alwaysBundle deps.alwaysBundle} instead.",
"deprecated": true
},
"$schema": { "type": "string" }
},
"required": [],
"additionalProperties": false
},
{
"type": "array",
"items": {
"type": "object",
"properties": {
"entry": {
"anyOf": [
{ "type": "string" },
{ "$ref": "#/$defs/Record" },
{
"type": "array",
"items": {
"anyOf": [{ "type": "string" }, { "$ref": "#/$defs/Record" }]
}
}
],
"description": "Defaults to `'src/index.ts'` if it exists.\n\nSupports glob patterns with negation to exclude files:",
"default": { "index": "src/index.ts" }
},
"deps": {
"$ref": "#/$defs/DepsConfig",
"description": "Dependency handling options."
},
"alias": { "$ref": "#/$defs/Record_519c04ca" },
"tsconfig": {
"anyOf": [
{ "type": "string" },
{ "const": false },
{ "const": true }
],
"default": true
},
"platform": {
"anyOf": [
{ "const": "node" },
{ "const": "neutral" },
{ "const": "browser" }
],
"description": "Specifies the target runtime platform for the build.\n\n- `node`: Node.js and compatible runtimes (e.g., Deno, Bun).\n For CJS format, this is always set to `node` and cannot be changed.\n- `neutral`: A platform-agnostic target with no specific runtime assumptions.\n- `browser`: Web browsers.",
"default": "node"
},
"target": {
"anyOf": [
{ "type": "string" },
{ "const": false },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Specifies the compilation target environment(s).\n\nDetermines the JavaScript version or runtime(s) for which the code should be compiled.\nIf not set, defaults to the value of `engines.node` in your project's `package.json`.\nIf no `engines.node` field exists, no syntax transformations are applied.\n\nAccepts a single target (e.g., `'es2020'`, `'node18'`, `'baseline-widely-available'`), an array of targets, or `false` to disable all transformations."
},
"env": {
"$ref": "#/$defs/Record_8bd28e51",
"description": "Compile-time env variables, which can be accessed via `import.meta.env` or `process.env`.",
"default": {}
},
"envFile": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Path(s) to env files providing compile-time env variables.\n\nFiles are loaded in order, so later files override earlier ones.\nMissing files are skipped."
},
"envPrefix": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "When loading env variables from `envFile`, only include variables with these prefixes.",
"default": "TSDOWN_"
},
"define": { "$ref": "#/$defs/Record_519c04ca" },
"shims": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Inject CJS `__dirname` and `__filename` shims into ESM output.\nOnly applies when {@linkcode platform} is set to `node`.\n\nNote: `import.meta.url`, `import.meta.dirname`, and `import.meta.filename`\nare always shimmed in CJS output, regardless of this option.",
"default": false
},
"treeshake": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "$ref": "#/$defs/TreeshakingOptions" }
],
"description": "Configure tree shaking options.",
"default": true
},
"loader": {
"$ref": "#/$defs/ModuleTypes",
"description": "Sets how input files are processed.\nFor example, use 'js' to treat files as JavaScript or 'base64' for images.\nLets you import or require files like images or fonts."
},
"nodeProtocol": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "const": "strip" }
],
"description": "Control whether built-in Node.js module imports use the `node:` protocol.\n\n- `true`: Add the `node:` prefix to built-in module imports.\n- `'strip'`: Remove the `node:` prefix from built-in module imports.\n- `false`: Do not transform built-in module imports.",
"default": false
},
"checks": {
"allOf": [
{ "$ref": "#/$defs/ChecksOptions" },
{
"type": "object",
"properties": {
"legacyCjs": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "If the config includes the `cjs` format and\none of its targets is a Node.js version that supports `require(esm)`\n(`^20.19.0 || >=22.12.0`),\nwarn the user about the deprecation of CommonJS.",
"default": true
}
},
"required": [],
"additionalProperties": false
}
],
"description": "Controls which warnings are emitted during the build process. Each option can be set to `true` (emit warning) or `false` (suppress warning)."
},
"inputOptions": {
"$ref": "#/$defs/InputOptions",
"description": "Use with caution; ensure you understand the implications."
},
"format": {
"anyOf": [
{ "const": "es" },
{ "const": "cjs" },
{ "const": "esm" },
{ "const": "module" },
{ "const": "commonjs" },
{ "const": "iife" },
{ "const": "umd" },
{ "type": "array", "items": { "$ref": "#/$defs/ModuleFormat" } },
{ "$ref": "#/$defs/Partial" }
],
"description": "Output format(s). Available formats are\n- `esm`: ESM\n- `cjs`: CommonJS\n- `iife`: IIFE\n- `umd`: UMD",
"default": "esm"
},
"globalName": { "type": "string" },
"outDir": { "type": "string", "default": "dist" },
"write": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to write the files to disk.\nThis option is incompatible with watch mode.",
"default": true
},
"sourcemap": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "const": "inline" },
{ "const": "hidden" }
],
"description": "Whether to generate source map files.\n\nNote that this option will always be `true` if you have\n{@link https://www.typescriptlang.org/tsconfig/#declarationMap `declarationMap`}\noption enabled in your `tsconfig.json`.",
"default": false
},
"clean": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Clean directories before build.\n\nDefault to output directory.",
"default": true
},
"minify": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "const": "dce-only" },
{ "$ref": "#/$defs/MinifyOptions" }
],
"default": "dce-only"
},
"footer": {
"anyOf": [
{ "type": "string" },
{ "$ref": "#/$defs/ChunkAddonObject" }
]
},
"banner": {
"anyOf": [
{ "type": "string" },
{ "$ref": "#/$defs/ChunkAddonObject" }
]
},
"unbundle": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Determines whether `unbundle` is enabled.\nWhen set to `true`, the output files will mirror the input file structure.",
"default": false
},
"root": {
"type": "string",
"description": "Specifies the root directory of input files, similar to TypeScript's `rootDir`.\nThis determines the output directory structure.\n\nBy default, the root is computed as the common base directory of all entry files."
},
"fixedExtension": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Use a fixed extension for output files.\nThe extension will always be `.cjs` or `.mjs`.\nOtherwise, it will depend on the package type.\n\nDefaults to `true` if {@linkcode platform} is set to `node`,\n`false` otherwise."
},
"hash": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "If enabled, appends hash to chunk filenames.",
"default": true
},
"cjsDefault": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Converts a single default export from an explicit CJS entry module to\n`module.exports`. It does not apply to non-entry chunks emitted in\nunbundle mode.",
"default": true
},
"outputOptions": {
"$ref": "#/$defs/OutputOptions",
"description": "Use with caution; ensure you understand the implications."
},
"cwd": {
"type": "string",
"description": "The working directory of the config file.\n- Defaults to {@linkcode process.cwdprocess.cwd()} for root config.\n- Defaults to the package directory for {@linkcode workspace} config."
},
"name": {
"type": "string",
"description": "The name to show in CLI output. This is useful for monorepos or workspaces.\nWhen using workspace mode, this option defaults to the package name from package.json.\nIn non-workspace mode, this option must be set explicitly for the name to show in the CLI output."
},
"logLevel": {
"anyOf": [
{ "const": "info" },
{ "const": "warn" },
{ "const": "silent" },
{ "const": "error" }
],
"description": "Log level.",
"default": "info"
},
"failOnWarn": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "const": "ci-only" },
{ "const": "local-only" }
],
"description": "If true, fails the build on warnings.",
"default": false
},
"suppressWarnings": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Suppress warnings whose message matches the given pattern(s).\n\nAccepts a string (substring match), a `RegExp`, an array of either, or a\npredicate function. Matched warnings are dropped before `failOnWarn` is\napplied, so they won't fail the build."
},
"customLogger": {
"$ref": "#/$defs/Logger",
"description": "Custom logger."
},
"fromVite": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "const": "vitest" }
],
"description": "Reuse config from Vite or Vitest (experimental)",
"default": false
},
"watch": {
"anyOf": [
{ "type": "string" },
{ "const": false },
{ "const": true },
{ "type": "array", "items": { "type": "string" } }
],
"default": false
},
"ignoreWatch": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Files or patterns to not watch while in watch mode."
},
"devtools": {
"$ref": "#/$defs/WithEnabled",
"description": "**[experimental]** Enable devtools.\n\nDevTools is still under development, and this is for early testers only.\n\nThis may slow down the build process significantly.",
"default": false
},
"onSuccess": {
"type": "string",
"description": "You can specify command to be executed after a successful build, specially useful for Watch mode"
},
"dts": {
"$ref": "#/$defs/WithEnabled_12743f1e",
"description": "Enables generation of TypeScript declaration files (`.d.ts`).\n\nBy default, this option is auto-detected:\n- If {@linkcode exe} is enabled, declaration file generation is disabled by default.\n- If the `types` or `typings` field is present in `package.json`, or if its `exports` field contains a `types` entry, declaration file generation is enabled by default.\n- Otherwise, if the resolved `tsconfig.json` has `declaration: true`, declaration file generation is enabled by default.\n- Otherwise, declaration file generation is disabled by default."
},
"unused": {
"$ref": "#/$defs/WithEnabled_12743f1e",
"description": "Enable unused dependencies check with `unplugin-unused`\nRequires `unplugin-unused` to be installed.",
"default": false
},
"publint": {
"$ref": "#/$defs/WithEnabled_2bd75970",
"description": "Run `publint` after bundling.\nRequires `publint` to be installed.",
"default": false
},
"attw": {
"$ref": "#/$defs/WithEnabled_acd1c896",
"description": "Run `arethetypeswrong` after bundling.\nRequires `@arethetypeswrong/core` to be installed.",
"default": false
},
"report": {
"$ref": "#/$defs/WithEnabled_64c49380",
"description": "Enable size reporting after bundling.",
"default": true
},
"globImport": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "`import.meta.glob` support.",
"default": true
},
"exports": {
"$ref": "#/$defs/WithEnabled_444b9595",
"description": "Generate package exports for `package.json`.\n\nThis will set the `exports` field in `package.json` to point to the\ngenerated files.",
"default": false
},
"css": {
"anyOf": [{ "const": false }, { "$ref": "#/$defs/CssOptions" }],
"description": "**[experimental]** CSS options.\nRequires `@tsdown/css` to be installed.\n\nSet to `false` to disable built-in CSS handling, leaving CSS files to\nuser plugins."
},
"copy": {
"anyOf": [
{ "type": "string" },
{ "$ref": "#/$defs/CopyEntry" },
{
"type": "array",
"items": {
"anyOf": [
{ "type": "string" },
{ "$ref": "#/$defs/CopyEntry" }
]
}
}
],
"description": "Copy files to another directory."
},
"hooks": { "$ref": "#/$defs/Partial_6b66b23d" },
"exe": {
"$ref": "#/$defs/WithEnabled_e5683b6a",
"description": "**[experimental]** Bundle as executable using Node.js SEA (Single Executable Applications).\n\nThis will bundle the output into a single executable file using Node.js SEA.\nNote that this is only supported on Node.js 25.7.0 and later, and is not supported in Bun or Deno.",
"default": false
},
"workspace": {
"anyOf": [
{ "type": "string" },
{ "const": true },
{ "type": "array", "items": { "type": "string" } },
{ "$ref": "#/$defs/Workspace" }
],
"description": "**[experimental]** Enable workspace mode.\nThis allows you to build multiple packages in a monorepo."
},
"external": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "$ref": "#/$defs/StringOrRegExp" } }
],
"description": "Cannot be combined with `deps.neverBundle`; setting both throws an error.\n\nDeprecated: Use {@linkcode DepsConfig.neverBundle deps.neverBundle} instead.",
"deprecated": true
},
"noExternal": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Cannot be combined with `deps.alwaysBundle`; setting both throws an error.\n\nDeprecated: Use {@linkcode DepsConfig.alwaysBundle deps.alwaysBundle} instead.",
"deprecated": true
},
"$schema": { "type": "string" }
},
"required": [],
"additionalProperties": false
}
}
],
"title": "UserConfig",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"Arrayable": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
]
},
"Record": {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": { "$ref": "#/$defs/Arrayable" }
},
"StringOrRegExp": { "type": "string" },
"Pick": {
"type": "object",
"properties": {
"alwaysBundle": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Force dependencies to be bundled, even if they are in `dependencies`, `peerDependencies`, or `optionalDependencies`."
},
"neverBundle": {
"anyOf": [
{ "type": "string" },
{ "const": true },
{ "type": "array", "items": { "$ref": "#/$defs/StringOrRegExp" } }
],
"description": "Mark dependencies as external (not bundled).\nAccepts strings, regular expressions, or Rolldown's\n{@linkcode ExternalOption}.\n\nSet to `true` to externalize **all** dependencies: every import that\nfollows npm package naming conventions is marked as external as written,\nwithout resolving it. Other non-relative imports (e.g. `#` subpath\nimports and path aliases like `~/`) are resolved, and kept external\nonly if they resolve into `node_modules`; otherwise the resolved local\nfile is bundled.\n\nUse {@linkcode alwaysBundle} to opt specific imports back into the bundle."
}
},
"required": [],
"additionalProperties": false
},
"DepsConfig": {
"type": "object",
"properties": {
"neverBundle": {
"anyOf": [
{ "type": "string" },
{ "const": true },
{ "type": "array", "items": { "$ref": "#/$defs/StringOrRegExp" } }
],
"description": "Mark dependencies as external (not bundled).\nAccepts strings, regular expressions, or Rolldown's\n{@linkcode ExternalOption}.\n\nSet to `true` to externalize **all** dependencies: every import that\nfollows npm package naming conventions is marked as external as written,\nwithout resolving it. Other non-relative imports (e.g. `#` subpath\nimports and path aliases like `~/`) are resolved, and kept external\nonly if they resolve into `node_modules`; otherwise the resolved local\nfile is bundled.\n\nUse {@linkcode alwaysBundle} to opt specific imports back into the bundle."
},
"alwaysBundle": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Force dependencies to be bundled, even if they are in `dependencies`, `peerDependencies`, or `optionalDependencies`."
},
"onlyBundle": {
"anyOf": [
{ "type": "string" },
{ "const": false },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Whitelist of dependencies allowed to be bundled from `node_modules`.\nThrows an error if any unlisted dependency is bundled.\n\n- `undefined` (default): Log an info-level hint if any `node_modules`\n dependencies are bundled.\n- `false`: Disable the hint and all checks about bundled dependencies.\n\nNote: Be sure to include all required sub-dependencies as well."
},
"onlyImport": {
"anyOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "Whitelist of packages that the emitted output is allowed to import.\nMatched against the package name, so subpath imports (e.g. `cac/deno`)\nare covered by listing the package (e.g. `cac`).\nNode built-in modules are always allowed to be imported\nwhen `platform` is `node`.\n\nNote: ES imports and dynamic import expressions are checked. CJS\n`require` calls are not detected."
},
"resolveDepSubpath": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Resolve dependency subpath imports to their actual package-relative paths\nwhen externalizing packages without an `exports` field.",
"default": false
},
"dts": {
"$ref": "#/$defs/Pick",
"description": "Override dependency bundling options for declaration file generation."
}
},
"required": [],
"additionalProperties": false
},
"Record_519c04ca": {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": { "type": "string" }
},
"Record_8bd28e51": {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": {}
},
"ModuleSideEffectsRule": {
"type": "object",
"properties": {
"external": { "anyOf": [{ "const": false }, { "const": true }] },
"sideEffects": { "anyOf": [{ "const": false }, { "const": true }] }
},
"required": ["sideEffects"],
"additionalProperties": false
},
"TreeshakingOptions": {
"type": "object",
"properties": {
"moduleSideEffects": {
"anyOf": [
{ "const": false },
{ "const": true },
{ "type": "array", "items": { "type": "string" } },
{
"type": "array",
"items": { "$ref": "#/$defs/ModuleSideEffectsRule" }
},
{ "const": "no-external" }
],
"description": "**Values:**\n\n- **`true`**: All modules are assumed to have side effects and will be included in the bundle even if none of their exports are used.\n- **`false`**: No modules have side effects. This enables aggressive tree-shaking, removing any modules whose exports are not used.\n- **`string[]`**: Array of module IDs that have side effects. Only modules in this list will be preserved if unused; all others can be tree-shaken when their exports are unused.\n- **`'no-external'`**: Assumes no external modules have side effects while preserving the default behavior for local modules.\n- **`ModuleSideEffectsRule[]`**: Array of rules with `test`, `external`, and `sideEffects` properties for fine-grained control.\n- **`function`**: Function that receives `(id, external)` and returns whether the module has side effects.\n\n**Important:** Setting this to `false` or using an array/string assumes that your modules and their dependencies have no side effects other than their exports. Only use this if you're certain that removing unused modules won't break your application.\n\n> [!NOTE]\n> **Performance: Prefer `ModuleSideEffectsRule[]` over functions**\n>\n> When possible, use rule-based configuration instead of functions. Rules are processed entirely in Rust, while JavaScript functions require runtime calls between Rust and JavaScript, which can hurt CPU utilization during builds.\n>\n> **Functions should be a last resort**: Only use the function signature when your logic cannot be expressed with patterns or simple string matching.\n>\n> **Rule advantages**: `ModuleSideEffectsRule[]` provides better performance by avoiding Rust-JavaScript runtime calls, clearer intent, and easier maintenance.",
"default": true
},
"annotations": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to respect `/*@__PURE__*\\/` annotations and other tree-shaking hints in the code.\n\nSee [related Oxc documentation](https://oxc.rs/docs/guide/usage/minifier/dead-code-elimination#pure-annotations) for more details.",
"default": true
},
"manualPureFunctions": {
"type": "array",
"items": { "type": "string" },
"description": "Array of function names that should be considered pure (no side effects) even if they can't be automatically detected as pure.\n\nSee [related Oxc documentation](https://oxc.rs/docs/guide/usage/minifier/dead-code-elimination#define-pure-functions) for more details.",
"default": []
},
"unknownGlobalSideEffects": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to assume that accessing unknown global properties might have side effects.\n\nSee [related Oxc documentation](https://oxc.rs/docs/guide/usage/minifier/dead-code-elimination#ignoring-global-variable-access-side-effects) for more details.",
"default": true
},
"invalidImportSideEffects": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to assume that invalid import statements might have side effects.\n\nSee [related Oxc documentation](https://oxc.rs/docs/guide/usage/minifier/dead-code-elimination#ignoring-invalid-import-statement-side-effects) for more details.",
"default": false
},
"commonjs": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to enable tree-shaking for CommonJS modules. When `true`, unused exports from CommonJS modules can be eliminated from the bundle, similar to ES modules. When disabled, CommonJS modules will always be included in their entirety.\n\nThis option allows rolldown to analyze `exports.property` assignments in CommonJS modules and remove unused exports while preserving the module's side effects.",
"default": true
},
"propertyReadSideEffects": {
"anyOf": [{ "const": false }, { "const": "always" }],
"description": "Controls whether reading properties from objects is considered to have side effects.\n\nSet to `false` for more aggressive tree-shaking behavior.\n\nSee [related Oxc documentation](https://oxc.rs/docs/guide/usage/minifier/dead-code-elimination#ignoring-property-read-side-effects) for more details.",
"default": "always"
},
"propertyWriteSideEffects": {
"anyOf": [{ "const": false }, { "const": "always" }],
"description": "Controls whether writing properties to objects is considered to have side effects.\n\nSet to `false` for more aggressive behavior.",
"default": "always"
}
},
"required": [],
"additionalProperties": false
},
"ModuleTypes": {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": {
"anyOf": [
{ "const": "js" },
{ "const": "jsx" },
{ "const": "ts" },
{ "const": "tsx" },
{ "const": "json" },
{ "const": "text" },
{ "const": "base64" },
{ "const": "dataurl" },
{ "const": "binary" },
{ "const": "empty" },
{ "const": "css" },
{ "const": "asset" },
{ "const": "copy" }
]
}
},
"ChecksOptions": {
"type": "object",
"properties": {
"circularDependency": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when detecting circular dependency.\n\nCircular dependencies lead to a bigger bundle size and sometimes cause execution order issues and are better to avoid.",
"default": false
},
"eval": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when detecting uses of direct `eval`s.\n\nSee [Avoiding Direct `eval` in Troubleshooting page](https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval) for more details.",
"default": true
},
"missingGlobalName": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when the `output.globals` option is missing when needed.\n\nSee [`output.globals`](https://rolldown.rs/reference/OutputOptions.globals).",
"default": true
},
"missingNameOptionForIifeExport": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when the `output.name` option is missing when needed.\n\nSee [`output.name`](https://rolldown.rs/reference/OutputOptions.name).",
"default": true
},
"invalidAnnotation": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when a `#__PURE__` / `@__PURE__` annotation has no effect due to its position.\n\nAnnotations placed where they cannot annotate a call expression (e.g. before a non-call expression,\nbefore a statement declaration, or between an identifier and `=` in a variable declarator) are\nignored by the parser. Matches Rollup's `INVALID_ANNOTATION` log code.\n\nBy default, warnings are emitted only for local project files inside `cwd` and outside\n`node_modules`. Set this option to `false` to disable the warning entirely.",
"default": true
},
"mixedExports": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when the way to export values is ambiguous.\n\nSee [`output.exports`](https://rolldown.rs/reference/OutputOptions.exports).",
"default": true
},
"unresolvedEntry": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when an entrypoint cannot be resolved.",
"default": true
},
"unresolvedImport": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when an import cannot be resolved.",
"default": true
},
"filenameConflict": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when files generated have the same name with different contents.",
"default": true
},
"moduleLevelDirective": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings for module-level directives other than `use strict`.",
"default": true
},
"commonJsVariableInEsm": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when a CommonJS variable is used in an ES module.\n\nCommonJS variables like `module` and `exports` are treated as global variables in ES modules and may not work as expected.",
"default": true
},
"importIsUndefined": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when an imported variable is not exported.\n\nIf the code is importing a variable that is not exported by the imported module, the value will always be `undefined`. This might be a mistake in the code.",
"default": true
},
"emptyImportMeta": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when `import.meta` is not supported with the output format and is replaced with an empty object (`{}`).\n\nSee [`import.meta` in Non-ESM Output Formats page](https://rolldown.rs/in-depth/non-esm-output-formats#import-meta) for more details.",
"default": true
},
"toleratedTransform": {
"anyOf": [{ "const": false }, { "const": true }],
"description": "Whether to emit warnings when detecting tolerated transform.",
"default": true
},
"cannotCallNamespace": {
"anyOf": [{ "const": false }, { "const": true }],