rolldown 1.0.0-beta.9-commit.0ec9e7d → 1.0.0-rc.1

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.
Files changed (68) hide show
  1. package/README.md +11 -0
  2. package/bin/cli.mjs +1 -0
  3. package/dist/cli-setup.mjs +17 -0
  4. package/dist/cli.mjs +1085 -1281
  5. package/dist/config.d.mts +2 -4
  6. package/dist/config.mjs +8 -5
  7. package/dist/experimental-index.d.mts +161 -76
  8. package/dist/experimental-index.mjs +227 -61
  9. package/dist/experimental-runtime-types.d.ts +98 -0
  10. package/dist/filter-index.d.mts +196 -4
  11. package/dist/filter-index.mjs +328 -4
  12. package/dist/get-log-filter.d.mts +7 -0
  13. package/dist/get-log-filter.mjs +48 -0
  14. package/dist/index.d.mts +4 -4
  15. package/dist/index.mjs +56 -5
  16. package/dist/parallel-plugin-worker.mjs +27 -33
  17. package/dist/parallel-plugin.d.mts +7 -8
  18. package/dist/parse-ast-index.d.mts +4 -5
  19. package/dist/parse-ast-index.mjs +2 -2
  20. package/dist/plugins-index.d.mts +30 -0
  21. package/dist/plugins-index.mjs +40 -0
  22. package/dist/shared/binding-B92Lq__Q.d.mts +1687 -0
  23. package/dist/shared/binding-C-UNREnT.mjs +585 -0
  24. package/dist/shared/bindingify-input-options-Cb-01HR1.mjs +2233 -0
  25. package/dist/shared/constructors-D_KFsTQ-.d.mts +28 -0
  26. package/dist/shared/constructors-aZ82R2dj.mjs +61 -0
  27. package/dist/shared/define-config-BVG4QvnP.mjs +7 -0
  28. package/dist/shared/define-config-DO4TBkJV.d.mts +3457 -0
  29. package/dist/shared/{load-config-Dll-92l5.mjs → load-config-D6cey0o1.mjs} +23 -33
  30. package/dist/shared/logging-wIy4zY9I.d.mts +50 -0
  31. package/dist/shared/logs-NH298mHo.mjs +183 -0
  32. package/dist/shared/{misc-DGAe2XOW.mjs → misc-CCZIsXVO.mjs} +1 -7
  33. package/dist/shared/normalize-string-or-regex-Dq50a7l9.mjs +61 -0
  34. package/dist/shared/parse-ast-index-B6LAhWD8.mjs +99 -0
  35. package/dist/shared/{prompt-CxjDC0Gn.cjs → prompt-tlfjalEt.mjs} +301 -308
  36. package/dist/shared/rolldown-CIC_OHw3.mjs +42 -0
  37. package/dist/shared/rolldown-build-KB1YaNe-.mjs +2369 -0
  38. package/dist/shared/watch-B2WRkpw2.mjs +379 -0
  39. package/package.json +86 -98
  40. package/dist/cli.cjs +0 -1748
  41. package/dist/config.cjs +0 -12
  42. package/dist/config.d.cts +0 -12
  43. package/dist/experimental-index.cjs +0 -132
  44. package/dist/experimental-index.d.cts +0 -96
  45. package/dist/filter-index.cjs +0 -105
  46. package/dist/filter-index.d.cts +0 -5
  47. package/dist/index.cjs +0 -9
  48. package/dist/index.d.cts +0 -4
  49. package/dist/parallel-plugin-worker.cjs +0 -33
  50. package/dist/parallel-plugin-worker.d.cts +0 -1
  51. package/dist/parallel-plugin.cjs +0 -8
  52. package/dist/parallel-plugin.d.cts +0 -15
  53. package/dist/parse-ast-index.cjs +0 -4
  54. package/dist/parse-ast-index.d.cts +0 -9
  55. package/dist/shared/binding.d-Dz3qQrbl.d.mts +0 -1682
  56. package/dist/shared/binding.d-QXzDcVmm.d.cts +0 -1682
  57. package/dist/shared/chunk--iN_1bjD.mjs +0 -33
  58. package/dist/shared/chunk-DDkG_k5U.cjs +0 -39
  59. package/dist/shared/define-config.d-CUcDq_vm.d.cts +0 -1080
  60. package/dist/shared/define-config.d-qV1PzX_C.d.mts +0 -1080
  61. package/dist/shared/load-config-Bx9W9x2a.cjs +0 -125
  62. package/dist/shared/misc-BKp5iIef.cjs +0 -67
  63. package/dist/shared/parse-ast-index-0m6JgGc9.mjs +0 -655
  64. package/dist/shared/parse-ast-index-Cn_efzjO.cjs +0 -697
  65. package/dist/shared/prompt-uGrwvyp0.mjs +0 -854
  66. package/dist/shared/src-B4EklR3U.mjs +0 -4704
  67. package/dist/shared/src-BzFe16tX.cjs +0 -4654
  68. /package/dist/{cli.d.cts → cli-setup.d.mts} +0 -0
@@ -1,1080 +0,0 @@
1
- import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingDynamicImportVarsPluginConfig, BindingHmrOutput, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, Bundler, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding.d-Dz3qQrbl.mjs";
2
- import { TopLevelFilterExpression } from "@rolldown/pluginutils";
3
- import { Program } from "@oxc-project/types";
4
-
5
- //#region src/log/logging.d.ts
6
- type LogLevel = "info" | "debug" | "warn";
7
- type LogLevelOption = LogLevel | "silent";
8
- type LogLevelWithError = LogLevel | "error";
9
- interface RollupLog {
10
- binding?: string;
11
- cause?: unknown;
12
- code?: string;
13
- exporter?: string;
14
- frame?: string;
15
- hook?: string;
16
- id?: string;
17
- ids?: string[];
18
- loc?: {
19
- column: number
20
- file?: string
21
- line: number
22
- };
23
- message: string;
24
- meta?: any;
25
- names?: string[];
26
- plugin?: string;
27
- pluginCode?: unknown;
28
- pos?: number;
29
- reexporter?: string;
30
- stack?: string;
31
- url?: string;
32
- }
33
- type RollupLogWithString = RollupLog | string;
34
- interface RollupError extends RollupLog {
35
- name?: string;
36
- stack?: string;
37
- watchFiles?: string[];
38
- }
39
- type LogOrStringHandler = (level: LogLevelWithError, log: RollupLogWithString) => void;
40
-
41
- //#endregion
42
- //#region src/types/misc.d.ts
43
- type SourcemapPathTransformOption = (relativeSourcePath: string, sourcemapPath: string) => string;
44
- type SourcemapIgnoreListOption = (relativeSourcePath: string, sourcemapPath: string) => boolean;
45
-
46
- //#endregion
47
- //#region src/utils/asset-source.d.ts
48
- type AssetSource = string | Uint8Array;
49
-
50
- //#endregion
51
- //#region src/types/rolldown-output.d.ts
52
- interface OutputAsset {
53
- type: "asset";
54
- fileName: string;
55
- /** @deprecated Use "originalFileNames" instead. */
56
- originalFileName: string | null;
57
- originalFileNames: string[];
58
- source: AssetSource;
59
- /** @deprecated Use "names" instead. */
60
- name: string | undefined;
61
- names: string[];
62
- }
63
- interface SourceMap {
64
- file: string;
65
- mappings: string;
66
- names: string[];
67
- sources: string[];
68
- sourcesContent: string[];
69
- version: number;
70
- debugId?: string;
71
- x_google_ignoreList?: number[];
72
- toString(): string;
73
- toUrl(): string;
74
- }
75
- interface RenderedModule {
76
- readonly code: string | null;
77
- renderedLength: number;
78
- renderedExports: string[];
79
- }
80
- interface RenderedChunk extends Omit<BindingRenderedChunk, "modules"> {
81
- type: "chunk";
82
- modules: {
83
- [id: string]: RenderedModule
84
- };
85
- name: string;
86
- isEntry: boolean;
87
- isDynamicEntry: boolean;
88
- facadeModuleId: string | null;
89
- moduleIds: Array<string>;
90
- exports: Array<string>;
91
- fileName: string;
92
- imports: Array<string>;
93
- dynamicImports: Array<string>;
94
- }
95
- interface OutputChunk {
96
- type: "chunk";
97
- code: string;
98
- name: string;
99
- isEntry: boolean;
100
- exports: string[];
101
- fileName: string;
102
- modules: {
103
- [id: string]: RenderedModule
104
- };
105
- imports: string[];
106
- dynamicImports: string[];
107
- facadeModuleId: string | null;
108
- isDynamicEntry: boolean;
109
- moduleIds: string[];
110
- map: SourceMap | null;
111
- sourcemapFileName: string | null;
112
- preliminaryFileName: string;
113
- }
114
- interface RolldownOutput {
115
- output: [OutputChunk, ...(OutputChunk | OutputAsset)[]];
116
- }
117
-
118
- //#endregion
119
- //#region src/types/utils.d.ts
120
- type MaybePromise<T> = T | Promise<T>;
121
- type NullValue<T = void> = T | undefined | null | void;
122
- type PartialNull<T> = { [P in keyof T] : T[P] | null };
123
- type MakeAsync<Function_> = Function_ extends (this: infer This, ...parameters: infer Arguments) => infer Return ? (this: This, ...parameters: Arguments) => Return | Promise<Return> : never;
124
- type MaybeArray<T> = T | T[];
125
- type StringOrRegExp = string | RegExp;
126
-
127
- //#endregion
128
- //#region src/options/output-options.d.ts
129
- type ModuleFormat = "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | "experimental-app";
130
- type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
131
- type ChunkFileNamesFunction = (chunkInfo: PreRenderedChunk) => string;
132
- interface PreRenderedAsset {
133
- names: string[];
134
- originalFileNames: string[];
135
- source: string | Uint8Array;
136
- type: "asset";
137
- }
138
- type AssetFileNamesFunction = (chunkInfo: PreRenderedAsset) => string;
139
- type GlobalsFunction = (name: string) => string;
140
- type MinifyOptions = BindingMinifyOptions;
141
- interface OutputOptions {
142
- dir?: string;
143
- file?: string;
144
- exports?: "auto" | "named" | "default" | "none";
145
- hashCharacters?: "base64" | "base36" | "hex";
146
- /**
147
- * Expected format of generated code.
148
- * - `'es'`, `'esm'` and `'module'` are the same format, all stand for ES module.
149
- * - `'cjs'` and `'commonjs'` are the same format, all stand for CommonJS module.
150
- * - `'iife'` stands for [Immediately Invoked Function Expression](https://developer.mozilla.org/en-US/docs/Glossary/IIFE).
151
- * - `'umd'` stands for [Universal Module Definition](https://github.com/umdjs/umd).
152
- *
153
- * @default 'esm'
154
- */
155
- format?: ModuleFormat;
156
- sourcemap?: boolean | "inline" | "hidden";
157
- sourcemapDebugIds?: boolean;
158
- sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
159
- sourcemapPathTransform?: SourcemapPathTransformOption;
160
- banner?: string | AddonFunction;
161
- footer?: string | AddonFunction;
162
- intro?: string | AddonFunction;
163
- outro?: string | AddonFunction;
164
- extend?: boolean;
165
- esModule?: boolean | "if-default-prop";
166
- assetFileNames?: string | AssetFileNamesFunction;
167
- entryFileNames?: string | ChunkFileNamesFunction;
168
- chunkFileNames?: string | ChunkFileNamesFunction;
169
- cssEntryFileNames?: string | ChunkFileNamesFunction;
170
- cssChunkFileNames?: string | ChunkFileNamesFunction;
171
- sanitizeFileName?: boolean | ((name: string) => string);
172
- minify?: boolean | "dce-only" | MinifyOptions;
173
- name?: string;
174
- globals?: Record<string, string> | GlobalsFunction;
175
- externalLiveBindings?: boolean;
176
- inlineDynamicImports?: boolean;
177
- /**
178
- * Allows you to do advanced chunking. Use it to reduce the number of common chunks or split out a chunk that hardly changes to obtain better caching.
179
- */
180
- advancedChunks?: {
181
- /**
182
- * - Type: `number`
183
- *
184
- * Global fallback of [`{group}.minSize`](#advancedchunks-groups-minsize), if it's not specified in the group.
185
- */
186
- minSize?: number
187
- /**
188
- * - Type: `number`
189
- *
190
- * Global fallback of [`{group}.maxSize`](#advancedchunks-groups-maxsize), if it's not specified in the group.
191
- */
192
- maxSize?: number
193
- /**
194
- * - Type: `number`
195
- *
196
- * Global fallback of [`{group}.maxModuleSize`](#advancedchunks-groups-maxmodulesize), if it's not specified in the group.
197
- */
198
- maxModuleSize?: number
199
- /**
200
- * - Type: `number`
201
- *
202
- * Global fallback of [`{group}.minModuleSize`](#advancedchunks-groups-minmodulesize), if it's not specified in the group.
203
- */
204
- minModuleSize?: number
205
- /**
206
- * - Type: `number`
207
- *
208
- * Global fallback of [`{group}.minShareCount`](#advancedchunks-groups-minsharecount), if it's not specified in the group.
209
- */
210
- minShareCount?: number
211
- /**
212
- * Groups to be used for advanced chunking.
213
- */
214
- groups?: {
215
- /**
216
- * - Type: `string`
217
- *
218
- * Name of the group. It will be also used as the name of the chunk and replaced the `[name]` placeholder in the `chunkFileNames` option.
219
- */
220
- name: string
221
- /**
222
- * - Type: `string | RegExp`
223
- *
224
- * Controls which modules are captured in this group.
225
- *
226
- * If `test` is a string, the module whose id contains the string will be captured.
227
- * If `test` is a regular expression, the module whose id matches the regular expression will be captured.
228
- * if `test` is empty, any module will be considered as matched.
229
- */
230
- test?: StringOrRegExp
231
- /**
232
- * - Type: `number`
233
- *
234
- * Priority of the group. Group with higher priority will be chosen first to match modules and create chunks. When converting the group to a chunk, modules of that group will be removed from other groups.
235
- *
236
- * If two groups have the same priority, the group whose index is smaller will be chosen.
237
- */
238
- priority?: number
239
- /**
240
- * - Type: `number`
241
- * - Default: `0`
242
- *
243
- * Minimum size of the desired chunk. If accumulated size of captured modules is smaller than this value, this group will be ignored.
244
- */
245
- minSize?: number
246
- /**
247
- * - Type: `number`
248
- * - Default: `1`
249
- *
250
- * Controls if a module should be captured based on how many entry chunks reference it.
251
- */
252
- minShareCount?: number
253
- /**
254
- * - Type: `number`
255
- * - Default: `Infinity`
256
- *
257
- * If final size of this group is larger than this value, this group will be spit into multiple groups that each has size closed to this value.
258
- */
259
- maxSize?: number
260
- /**
261
- * - Type: `number`
262
- * - Default: `Infinity`
263
- *
264
- * Controls a module could only be captured if its size is smaller or equal than this value.
265
- */
266
- maxModuleSize?: number
267
- /**
268
- * - Type: `number`
269
- * - Default: `0`
270
- *
271
- * Controls a module could only be captured if its size is larger or equal than this value.
272
- */
273
- minModuleSize?: number
274
- }[]
275
- };
276
- /**
277
- * Control comments in the output.
278
- *
279
- * - `none`: no comments
280
- * - `inline`: preserve comments that contain `@license`, `@preserve` or starts with `//!` `/*!`
281
- */
282
- legalComments?: "none" | "inline";
283
- plugins?: RolldownOutputPluginOption;
284
- polyfillRequire?: boolean;
285
- hoistTransitiveImports?: false;
286
- preserveModules?: boolean;
287
- virtualDirname?: string;
288
- preserveModulesRoot?: string;
289
- }
290
-
291
- //#endregion
292
- //#region src/api/build.d.ts
293
- interface BuildOptions extends InputOptions {
294
- /**
295
- * Write the output to the file system
296
- *
297
- * @default true
298
- */
299
- write?: boolean;
300
- output?: OutputOptions;
301
- }
302
- declare function build(options: BuildOptions): Promise<RolldownOutput>;
303
- /**
304
- * Build multiple outputs __sequentially__.
305
- */
306
- /**
307
- * Build multiple outputs __sequentially__.
308
- */
309
- declare function build(options: BuildOptions[]): Promise<RolldownOutput[]>;
310
-
311
- //#endregion
312
- //#region src/api/rolldown/rolldown-build.d.ts
313
- declare class RolldownBuild {
314
- #private;
315
- constructor(inputOptions: InputOptions);
316
- get closed(): boolean;
317
- generate(outputOptions?: OutputOptions): Promise<RolldownOutput>;
318
- write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
319
- close(): Promise<void>;
320
- [Symbol.asyncDispose](): Promise<void>;
321
- generateHmrPatch(changedFiles: string[]): Promise<BindingHmrOutput | undefined>;
322
- hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrOutput | undefined>;
323
- get watchFiles(): Promise<string[]>;
324
- }
325
-
326
- //#endregion
327
- //#region src/api/rolldown/index.d.ts
328
- declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
329
-
330
- //#endregion
331
- //#region src/options/watch-options.d.ts
332
- interface WatchOptions extends InputOptions {
333
- output?: OutputOptions | OutputOptions[];
334
- }
335
-
336
- //#endregion
337
- //#region src/api/watch/watch-emitter.d.ts
338
- type WatcherEvent = "close" | "event" | "restart" | "change";
339
- type ChangeEvent$1 = "create" | "update" | "delete";
340
- type RolldownWatchBuild = Bundler;
341
- type RolldownWatcherEvent = {
342
- code: "START"
343
- } | {
344
- code: "BUNDLE_START"
345
- } | {
346
- code: "BUNDLE_END"
347
- duration: number
348
- output: readonly string[]
349
- result: RolldownWatchBuild
350
- } | {
351
- code: "END"
352
- } | {
353
- code: "ERROR"
354
- error: Error
355
- result: RolldownWatchBuild
356
- };
357
- declare class WatcherEmitter {
358
- listeners: Map<WatcherEvent, Array<(...parameters: any[]) => MaybePromise<void>>>;
359
- timer: any;
360
- constructor();
361
- on(event: "change", listener: (id: string, change: {
362
- event: ChangeEvent$1
363
- }) => MaybePromise<void>): this;
364
- on(event: "event", listener: (data: RolldownWatcherEvent) => MaybePromise<void>): this;
365
- on(event: "restart" | "close", listener: () => MaybePromise<void>): this;
366
- off(event: WatcherEvent, listener: (...parameters: any[]) => MaybePromise<void>): this;
367
- onEvent(event: BindingWatcherEvent): Promise<void>;
368
- close(): Promise<void>;
369
- }
370
- type RolldownWatcher = WatcherEmitter;
371
-
372
- //#endregion
373
- //#region src/api/watch/index.d.ts
374
- declare const watch: (input: WatchOptions | WatchOptions[]) => RolldownWatcher;
375
-
376
- //#endregion
377
- //#region src/log/log-handler.d.ts
378
- type LoggingFunction = (log: RollupLog | string | (() => RollupLog | string)) => void;
379
- type LoggingFunctionWithPosition = (log: RollupLog | string | (() => RollupLog | string), pos?: number | {
380
- column: number
381
- line: number
382
- }) => void;
383
- type WarningHandlerWithDefault = (warning: RollupLog, defaultHandler: LoggingFunction) => void;
384
-
385
- //#endregion
386
- //#region src/options/normalized-input-options.d.ts
387
- interface NormalizedInputOptions {
388
- input: string[] | Record<string, string>;
389
- cwd: string | undefined;
390
- platform: InputOptions["platform"];
391
- shimMissingExports: boolean;
392
- }
393
-
394
- //#endregion
395
- //#region src/options/normalized-output-options.d.ts
396
- type InternalModuleFormat = "es" | "cjs" | "iife" | "umd" | "app";
397
- interface NormalizedOutputOptions {
398
- name: string | undefined;
399
- file: string | undefined;
400
- dir: string | undefined;
401
- entryFileNames: string | ChunkFileNamesFunction;
402
- chunkFileNames: string | ChunkFileNamesFunction;
403
- assetFileNames: string | AssetFileNamesFunction;
404
- format: InternalModuleFormat;
405
- exports: NonNullable<OutputOptions["exports"]>;
406
- sourcemap: boolean | "inline" | "hidden";
407
- cssEntryFileNames: string | ChunkFileNamesFunction;
408
- cssChunkFileNames: string | ChunkFileNamesFunction;
409
- inlineDynamicImports: boolean;
410
- externalLiveBindings: boolean;
411
- banner: AddonFunction;
412
- footer: AddonFunction;
413
- intro: AddonFunction;
414
- outro: AddonFunction;
415
- esModule: boolean | "if-default-prop";
416
- extend: boolean;
417
- globals: Record<string, string> | GlobalsFunction;
418
- hashCharacters: "base64" | "base36" | "hex";
419
- sourcemapDebugIds: boolean;
420
- sourcemapIgnoreList: SourcemapIgnoreListOption;
421
- sourcemapPathTransform: SourcemapPathTransformOption | undefined;
422
- minify: false | BindingMinifyOptions;
423
- legalComments: "none" | "inline";
424
- polyfillRequire: boolean;
425
- plugins: RolldownPlugin[];
426
- preserveModules: boolean;
427
- virtualDirname: string;
428
- preserveModulesRoot?: string;
429
- }
430
-
431
- //#endregion
432
- //#region src/plugin/hook-filter.d.ts
433
- type GeneralHookFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
434
- include?: MaybeArray<Value>
435
- exclude?: MaybeArray<Value>
436
- };
437
- interface FormalModuleTypeFilter {
438
- include?: ModuleType[];
439
- }
440
- type ModuleTypeFilter = ModuleType[] | FormalModuleTypeFilter;
441
- interface HookFilter {
442
- /**
443
- * This filter is used to do a pre-test to determine whether the hook should be called.
444
- *
445
- * @example
446
- * Include all `id`s that contain `node_modules` in the path.
447
- * ```js
448
- * { id: '**'+'/node_modules/**' }
449
- * ```
450
- * @example
451
- * Include all `id`s that contain `node_modules` or `src` in the path.
452
- * ```js
453
- * { id: ['**'+'/node_modules/**', '**'+'/src/**'] }
454
- * ```
455
- * @example
456
- * Include all `id`s that start with `http`
457
- * ```js
458
- * { id: /^http/ }
459
- * ```
460
- * @example
461
- * Exclude all `id`s that contain `node_modules` in the path.
462
- * ```js
463
- * { id: { exclude: '**'+'/node_modules/**' } }
464
- * ```
465
- * @example
466
- * Formal pattern to define includes and excludes.
467
- * ```
468
- * { id : {
469
- * include: ['**'+'/foo/**', /bar/],
470
- * exclude: ['**'+'/baz/**', /qux/]
471
- * }}
472
- * ```
473
- */
474
- id?: GeneralHookFilter;
475
- moduleType?: ModuleTypeFilter;
476
- code?: GeneralHookFilter;
477
- }
478
- type TUnionWithTopLevelFilterExpressionArray<T> = T | TopLevelFilterExpression[];
479
-
480
- //#endregion
481
- //#region src/plugin/minimal-plugin-context.d.ts
482
- interface PluginContextMeta {
483
- rollupVersion: string;
484
- rolldownVersion: string;
485
- watchMode: boolean;
486
- }
487
- interface MinimalPluginContext {
488
- readonly pluginName: string;
489
- error: (e: RollupError | string) => never;
490
- info: LoggingFunction;
491
- warn: LoggingFunction;
492
- debug: LoggingFunction;
493
- meta: PluginContextMeta;
494
- }
495
-
496
- //#endregion
497
- //#region src/plugin/parallel-plugin.d.ts
498
- type ParallelPlugin = {
499
- /** @internal */
500
- _parallel: {
501
- fileUrl: string
502
- options: unknown
503
- }
504
- };
505
- type DefineParallelPluginResult<Options> = (options: Options) => ParallelPlugin;
506
- declare function defineParallelPlugin<Options>(pluginPath: string): DefineParallelPluginResult<Options>;
507
-
508
- //#endregion
509
- //#region src/types/module-info.d.ts
510
- interface ModuleInfo extends ModuleOptions {
511
- /**
512
- * Unsupported at rolldown
513
- */
514
- ast: any;
515
- code: string | null;
516
- id: string;
517
- importers: string[];
518
- dynamicImporters: string[];
519
- importedIds: string[];
520
- dynamicallyImportedIds: string[];
521
- exports: string[];
522
- isEntry: boolean;
523
- }
524
-
525
- //#endregion
526
- //#region src/plugin/plugin-context.d.ts
527
- interface EmittedAsset {
528
- type: "asset";
529
- name?: string;
530
- fileName?: string;
531
- originalFileName?: string | null;
532
- source: AssetSource;
533
- }
534
- interface EmittedChunk {
535
- type: "chunk";
536
- name?: string;
537
- fileName?: string;
538
- id: string;
539
- importer?: string;
540
- }
541
- type EmittedFile = EmittedAsset | EmittedChunk;
542
- interface PluginContextResolveOptions {
543
- skipSelf?: boolean;
544
- custom?: CustomPluginOptions;
545
- }
546
- type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
547
- interface PluginContext extends MinimalPluginContext {
548
- emitFile(file: EmittedFile): string;
549
- getFileName(referenceId: string): string;
550
- getModuleIds(): IterableIterator<string>;
551
- getModuleInfo: GetModuleInfo;
552
- addWatchFile(id: string): void;
553
- load(options: {
554
- id: string
555
- resolveDependencies?: boolean
556
- } & Partial<PartialNull<ModuleOptions>>): Promise<ModuleInfo>;
557
- parse(input: string, options?: ParserOptions | undefined | null): Program;
558
- resolve(source: string, importer?: string, options?: PluginContextResolveOptions): Promise<ResolvedId | null>;
559
- }
560
-
561
- //#endregion
562
- //#region src/plugin/transform-plugin-context.d.ts
563
- interface TransformPluginContext extends PluginContext {
564
- debug: LoggingFunctionWithPosition;
565
- info: LoggingFunctionWithPosition;
566
- warn: LoggingFunctionWithPosition;
567
- error(e: RollupError | string, pos?: number | {
568
- column: number
569
- line: number
570
- }): never;
571
- getCombinedSourcemap(): SourceMap;
572
- }
573
-
574
- //#endregion
575
- //#region src/types/module-side-effects.d.ts
576
- interface ModuleSideEffectsRule {
577
- test?: RegExp;
578
- external?: boolean;
579
- sideEffects: boolean;
580
- }
581
- type ModuleSideEffectsOption = boolean | ModuleSideEffectsRule[] | ((id: string, isResolved: boolean) => boolean | undefined) | "no-external";
582
- type TreeshakingOptions = {
583
- moduleSideEffects?: ModuleSideEffectsOption
584
- annotations?: boolean
585
- manualPureFunctions?: string[]
586
- unknownGlobalSideEffects?: boolean
587
- } | boolean;
588
-
589
- //#endregion
590
- //#region src/types/output-bundle.d.ts
591
- interface OutputBundle {
592
- [fileName: string]: OutputAsset | OutputChunk;
593
- }
594
-
595
- //#endregion
596
- //#region src/types/sourcemap.d.ts
597
- interface ExistingRawSourceMap {
598
- file?: string | null;
599
- mappings: string;
600
- names?: string[];
601
- sources?: (string | null)[];
602
- sourcesContent?: (string | null)[];
603
- sourceRoot?: string;
604
- version?: number;
605
- x_google_ignoreList?: number[];
606
- }
607
- type SourceMapInput = ExistingRawSourceMap | string | null;
608
-
609
- //#endregion
610
- //#region src/index.d.ts
611
- declare const VERSION: string;
612
-
613
- //#endregion
614
- //#region src/builtin-plugin/constructors.d.ts
615
- declare class BuiltinPlugin {
616
- name: BindingBuiltinPluginName;
617
- _options?: unknown;
618
- constructor(name: BindingBuiltinPluginName, _options?: unknown);
619
- }
620
- declare function modulePreloadPolyfillPlugin(): BuiltinPlugin;
621
- declare function dynamicImportVarsPlugin(config?: BindingDynamicImportVarsPluginConfig): BuiltinPlugin;
622
- declare function importGlobPlugin(config?: BindingImportGlobPluginConfig): BuiltinPlugin;
623
- declare function reporterPlugin(config?: BindingReporterPluginConfig): BuiltinPlugin;
624
- declare function manifestPlugin(config?: BindingManifestPluginConfig): BuiltinPlugin;
625
- declare function wasmHelperPlugin(): BuiltinPlugin;
626
- declare function wasmFallbackPlugin(): BuiltinPlugin;
627
- declare function loadFallbackPlugin(): BuiltinPlugin;
628
- declare function jsonPlugin(config?: BindingJsonPluginConfig): BuiltinPlugin;
629
- declare function buildImportAnalysisPlugin(config: BindingBuildImportAnalysisPluginConfig): BuiltinPlugin;
630
- declare function viteResolvePlugin(config: BindingViteResolvePluginConfig): BuiltinPlugin;
631
- type ModuleFederationPluginOption = Omit<BindingModuleFederationPluginOption, "remotes"> & {
632
- remotes?: Record<string, string | BindingRemote>
633
- manifest?: boolean | BindingMfManifest
634
- };
635
- declare function moduleFederationPlugin(config: ModuleFederationPluginOption): BuiltinPlugin;
636
- declare function isolatedDeclarationPlugin(config?: BindingIsolatedDeclarationPluginConfig): BuiltinPlugin;
637
- declare function assetPlugin(config?: BindingAssetPluginConfig): BuiltinPlugin;
638
- declare function webWorkerPostPlugin(): BuiltinPlugin;
639
-
640
- //#endregion
641
- //#region src/constants/plugin.d.ts
642
- declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"];
643
- declare const ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES: readonly ["augmentChunkHash", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "generateBundle"];
644
- declare const ENUMERATED_PLUGIN_HOOK_NAMES: [...typeof ENUMERATED_INPUT_PLUGIN_HOOK_NAMES, ...typeof ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES, "footer", "banner", "intro", "outro"];
645
- type EnumeratedPluginHookNames = typeof ENUMERATED_PLUGIN_HOOK_NAMES;
646
- /**
647
- * Names of all hooks in a `Plugin` object. Does not include `name` and `api`, since they are not hooks.
648
- */
649
- /**
650
- * Names of all hooks in a `Plugin` object. Does not include `name` and `api`, since they are not hooks.
651
- */
652
- type PluginHookNames = EnumeratedPluginHookNames[number];
653
- /**
654
- * Names of all defined hooks. It's like
655
- * ```ts
656
- * type DefinedHookNames = {
657
- * options: 'options',
658
- * buildStart: 'buildStart',
659
- * ...
660
- * }
661
- * ```
662
- */
663
- /**
664
- * Names of all defined hooks. It's like
665
- * ```ts
666
- * type DefinedHookNames = {
667
- * options: 'options',
668
- * buildStart: 'buildStart',
669
- * ...
670
- * }
671
- * ```
672
- */
673
- type DefinedHookNames = { readonly [K in PluginHookNames] : K };
674
- /**
675
- * Names of all defined hooks. It's like
676
- * ```js
677
- * const DEFINED_HOOK_NAMES ={
678
- * options: 'options',
679
- * buildStart: 'buildStart',
680
- * ...
681
- * }
682
- * ```
683
- */
684
- /**
685
- * Names of all defined hooks. It's like
686
- * ```js
687
- * const DEFINED_HOOK_NAMES ={
688
- * options: 'options',
689
- * buildStart: 'buildStart',
690
- * ...
691
- * }
692
- * ```
693
- */
694
- declare const DEFINED_HOOK_NAMES: DefinedHookNames;
695
-
696
- //#endregion
697
- //#region src/plugin/with-filter.d.ts
698
- type OverrideFilterObject = {
699
- transform?: HookFilterExtension<"transform">["filter"]
700
- resolveId?: HookFilterExtension<"resolveId">["filter"]
701
- load?: HookFilterExtension<"load">["filter"]
702
- pluginNamePattern?: StringOrRegExp[]
703
- };
704
- declare function withFilter<
705
- A,
706
- T extends RolldownPluginOption<A>
707
- >(pluginOption: T, filterObject: OverrideFilterObject | OverrideFilterObject[]): T;
708
-
709
- //#endregion
710
- //#region src/plugin/index.d.ts
711
- type ModuleSideEffects = boolean | "no-treeshake" | null;
712
- type ModuleType = "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | (string & {});
713
- type ImportKind = BindingHookResolveIdExtraArgs["kind"];
714
- interface CustomPluginOptions {
715
- [plugin: string]: any;
716
- }
717
- interface ModuleOptions {
718
- moduleSideEffects: ModuleSideEffects;
719
- meta: CustomPluginOptions;
720
- invalidate?: boolean;
721
- }
722
- interface ResolvedId extends ModuleOptions {
723
- external: boolean | "absolute";
724
- id: string;
725
- }
726
- interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
727
- external?: boolean | "absolute" | "relative";
728
- id: string;
729
- }
730
- interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
731
- code: string;
732
- map?: SourceMapInput;
733
- moduleType?: ModuleType;
734
- }
735
- interface ResolveIdExtraOptions {
736
- custom?: CustomPluginOptions;
737
- isEntry: boolean;
738
- kind: BindingHookResolveIdExtraArgs["kind"];
739
- }
740
- type ResolveIdResult = string | NullValue | false | PartialResolvedId;
741
- type LoadResult = NullValue | string | SourceDescription;
742
- type TransformResult = NullValue | string | Partial<SourceDescription>;
743
- type RenderedChunkMeta = {
744
- chunks: Record<string, RenderedChunk>
745
- };
746
- interface FunctionPluginHooks {
747
- [DEFINED_HOOK_NAMES.onLog]: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => NullValue | boolean;
748
- [DEFINED_HOOK_NAMES.options]: (this: MinimalPluginContext, options: InputOptions) => NullValue | InputOptions;
749
- [DEFINED_HOOK_NAMES.outputOptions]: (this: MinimalPluginContext, options: OutputOptions) => NullValue | OutputOptions;
750
- [DEFINED_HOOK_NAMES.buildStart]: (this: PluginContext, options: NormalizedInputOptions) => void;
751
- [DEFINED_HOOK_NAMES.resolveId]: (this: PluginContext, source: string, importer: string | undefined, extraOptions: ResolveIdExtraOptions) => ResolveIdResult;
752
- /**
753
- * @deprecated
754
- * This hook is only for rollup plugin compatibility. Please use `resolveId` instead.
755
- */
756
- [DEFINED_HOOK_NAMES.resolveDynamicImport]: (this: PluginContext, source: string, importer: string | undefined) => ResolveIdResult;
757
- [DEFINED_HOOK_NAMES.load]: (this: PluginContext, id: string) => MaybePromise<LoadResult>;
758
- [DEFINED_HOOK_NAMES.transform]: (this: TransformPluginContext, code: string, id: string, meta: BindingTransformHookExtraArgs & {
759
- moduleType: ModuleType
760
- }) => TransformResult;
761
- [DEFINED_HOOK_NAMES.moduleParsed]: (this: PluginContext, moduleInfo: ModuleInfo) => void;
762
- [DEFINED_HOOK_NAMES.buildEnd]: (this: PluginContext, err?: Error) => void;
763
- [DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
764
- [DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | {
765
- code: string
766
- map?: SourceMapInput
767
- };
768
- [DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RenderedChunk) => string | void;
769
- [DEFINED_HOOK_NAMES.renderError]: (this: PluginContext, error: Error) => void;
770
- [DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
771
- [DEFINED_HOOK_NAMES.writeBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle) => void;
772
- [DEFINED_HOOK_NAMES.closeBundle]: (this: PluginContext) => void;
773
- [DEFINED_HOOK_NAMES.watchChange]: (this: PluginContext, id: string, event: {
774
- event: ChangeEvent
775
- }) => void;
776
- [DEFINED_HOOK_NAMES.closeWatcher]: (this: PluginContext) => void;
777
- }
778
- type ChangeEvent = "create" | "update" | "delete";
779
- type PluginOrder = "pre" | "post" | null;
780
- type ObjectHookMeta = {
781
- order?: PluginOrder
782
- };
783
- type ObjectHook<
784
- T,
785
- O = {}
786
- > = T | ({
787
- handler: T
788
- } & ObjectHookMeta & O);
789
- type SyncPluginHooks = DefinedHookNames["augmentChunkHash" | "onLog" | "outputOptions"];
790
- type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
791
- type FirstPluginHooks = DefinedHookNames["load" | "resolveDynamicImport" | "resolveId"];
792
- type SequentialPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "onLog" | "options" | "outputOptions" | "renderChunk" | "transform"];
793
- type AddonHooks = DefinedHookNames["banner" | "footer" | "intro" | "outro"];
794
- type OutputPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "outputOptions" | "renderChunk" | "renderError" | "renderStart" | "writeBundle"];
795
- type ParallelPluginHooks = Exclude<keyof FunctionPluginHooks | AddonHooks, FirstPluginHooks | SequentialPluginHooks>;
796
- type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends "transform" ? {
797
- filter?: TUnionWithTopLevelFilterExpressionArray<HookFilter>
798
- } : K extends "load" ? {
799
- filter?: TUnionWithTopLevelFilterExpressionArray<Pick<HookFilter, "id">>
800
- } : K extends "resolveId" ? {
801
- filter?: TUnionWithTopLevelFilterExpressionArray<{
802
- id?: GeneralHookFilter<RegExp>
803
- }>
804
- } : K extends "renderChunk" ? {
805
- filter?: TUnionWithTopLevelFilterExpressionArray<Pick<HookFilter, "code">>
806
- } : {};
807
- type PluginHooks = { [K in keyof FunctionPluginHooks] : ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], HookFilterExtension<K> & (K extends ParallelPluginHooks ? {
808
- /**
809
- * @deprecated
810
- * this is only for rollup Plugin type compatibility.
811
- * hooks always work as `sequential: true`.
812
- */
813
- sequential?: boolean
814
- } : {})> };
815
- type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>;
816
- type AddonHook = string | AddonHookFunction;
817
- interface OutputPlugin extends Partial<{ [K in OutputPluginHooks] : PluginHooks[K] }>, Partial<{ [K in AddonHooks] : ObjectHook<AddonHook> }> {
818
- name: string;
819
- }
820
- interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
821
- api?: A;
822
- }
823
- type RolldownPlugin<A = any> = Plugin<A> | BuiltinPlugin | ParallelPlugin;
824
- type RolldownPluginOption<A = any> = MaybePromise<NullValue<RolldownPlugin<A>> | {
825
- name: string
826
- } | false | RolldownPluginOption[]>;
827
- type RolldownOutputPlugin = OutputPlugin | BuiltinPlugin;
828
- type RolldownOutputPluginOption = MaybePromise<NullValue<RolldownOutputPlugin> | {
829
- name: string
830
- } | false | RolldownOutputPluginOption[]>;
831
-
832
- //#endregion
833
- //#region src/options/generated/checks-options.d.ts
834
- interface ChecksOptions {
835
- /**
836
- * Whether to emit warning when detecting circular dependency
837
- * @default false
838
- */
839
- circularDependency?: boolean;
840
- /**
841
- * Whether to emit warning when detecting eval
842
- * @default true
843
- */
844
- eval?: boolean;
845
- /**
846
- * Whether to emit warning when detecting missing global name
847
- * @default true
848
- */
849
- missingGlobalName?: boolean;
850
- /**
851
- * Whether to emit warning when detecting missing name option for iife export
852
- * @default true
853
- */
854
- missingNameOptionForIifeExport?: boolean;
855
- /**
856
- * Whether to emit warning when detecting mixed export
857
- * @default true
858
- */
859
- mixedExport?: boolean;
860
- /**
861
- * Whether to emit warning when detecting unresolved entry
862
- * @default true
863
- */
864
- unresolvedEntry?: boolean;
865
- /**
866
- * Whether to emit warning when detecting unresolved import
867
- * @default true
868
- */
869
- unresolvedImport?: boolean;
870
- /**
871
- * Whether to emit warning when detecting filename conflict
872
- * @default true
873
- */
874
- filenameConflict?: boolean;
875
- /**
876
- * Whether to emit warning when detecting common js variable in esm
877
- * @default true
878
- */
879
- commonJsVariableInEsm?: boolean;
880
- /**
881
- * Whether to emit warning when detecting import is undefined
882
- * @default true
883
- */
884
- importIsUndefined?: boolean;
885
- /**
886
- * Whether to emit warning when detecting configuration field conflict
887
- * @default true
888
- */
889
- configurationFieldConflict?: boolean;
890
- }
891
-
892
- //#endregion
893
- //#region src/options/input-options.d.ts
894
- type InputOption = string | string[] | Record<string, string>;
895
- type OxcTransformOption = Omit<TransformOptions, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject">;
896
- type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
897
- type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset">;
898
- interface WatcherOptions {
899
- skipWrite?: boolean;
900
- buildDelay?: number;
901
- notify?: {
902
- pollInterval?: number
903
- compareContents?: boolean
904
- };
905
- include?: StringOrRegExp | StringOrRegExp[];
906
- exclude?: StringOrRegExp | StringOrRegExp[];
907
- }
908
- type MakeAbsoluteExternalsRelative = boolean | "ifRelativeSource";
909
- type HmrOptions = boolean | {
910
- host?: string
911
- port?: number
912
- implement?: string
913
- };
914
- interface InputOptions {
915
- input?: InputOption;
916
- plugins?: RolldownPluginOption;
917
- external?: ExternalOption;
918
- resolve?: {
919
- /**
920
- * > [!WARNING]
921
- * > `resolve.alias` will not call `resolveId` hooks of other plugin.
922
- * > If you want to call `resolveId` hooks of other plugin, use `aliasPlugin` from `rolldown/experimental` instead.
923
- * > You could find more discussion in [this issue](https://github.com/rolldown/rolldown/issues/3615)
924
- */
925
- alias?: Record<string, string[] | string>
926
- aliasFields?: string[][]
927
- conditionNames?: string[]
928
- /**
929
- * Map of extensions to alternative extensions.
930
- *
931
- * With writing `import './foo.js'` in a file, you want to resolve it to `foo.ts` instead of `foo.js`.
932
- * You can achieve this by setting: `extensionAlias: { '.js': ['.ts', '.js'] }`.
933
- */
934
- extensionAlias?: Record<string, string[]>
935
- exportsFields?: string[][]
936
- extensions?: string[]
937
- mainFields?: string[]
938
- mainFiles?: string[]
939
- modules?: string[]
940
- symlinks?: boolean
941
- tsconfigFilename?: string
942
- };
943
- cwd?: string;
944
- /**
945
- * Expected platform where the code run.
946
- *
947
- * @default "browser"
948
- */
949
- platform?: "node" | "browser" | "neutral";
950
- shimMissingExports?: boolean;
951
- treeshake?: boolean | TreeshakingOptions;
952
- logLevel?: LogLevelOption;
953
- onLog?: (level: LogLevel, log: RollupLog, defaultHandler: LogOrStringHandler) => void;
954
- onwarn?: (warning: RollupLog, defaultHandler: (warning: RollupLogWithString | (() => RollupLogWithString)) => void) => void;
955
- moduleTypes?: ModuleTypes;
956
- experimental?: {
957
- enableComposingJsPlugins?: boolean
958
- strictExecutionOrder?: boolean
959
- disableLiveBindings?: boolean
960
- viteMode?: boolean
961
- resolveNewUrlToAsset?: boolean
962
- hmr?: HmrOptions
963
- attachDebugInfo?: boolean
964
- };
965
- /**
966
- * Replace global variables or [property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) with the provided values.
967
- *
968
- * # Examples
969
- *
970
- * - Replace the global variable `IS_PROD` with `true`
971
- *
972
- * ```js rolldown.config.js
973
- * export default defineConfig({ define: { IS_PROD: 'true' // or JSON.stringify(true) } })
974
- * ```
975
- *
976
- * Result:
977
- *
978
- * ```js
979
- * // Input
980
- * if (IS_PROD) {
981
- * console.log('Production mode')
982
- * }
983
- *
984
- * // After bundling
985
- * if (true) {
986
- * console.log('Production mode')
987
- * }
988
- * ```
989
- *
990
- * - Replace the property accessor `process.env.NODE_ENV` with `'production'`
991
- *
992
- * ```js rolldown.config.js
993
- * export default defineConfig({ define: { 'process.env.NODE_ENV': "'production'" } })
994
- * ```
995
- *
996
- * Result:
997
- *
998
- * ```js
999
- * // Input
1000
- * if (process.env.NODE_ENV === 'production') {
1001
- * console.log('Production mode')
1002
- * }
1003
- *
1004
- * // After bundling
1005
- * if ('production' === 'production') {
1006
- * console.log('Production mode')
1007
- * }
1008
- *
1009
- * ```
1010
- */
1011
- define?: Record<string, string>;
1012
- /**
1013
- * Inject import statements on demand.
1014
- *
1015
- * ## Supported patterns
1016
- * ```js
1017
- * {
1018
- * // import { Promise } from 'es6-promise'
1019
- * Promise: ['es6-promise', 'Promise'],
1020
- *
1021
- * // import { Promise as P } from 'es6-promise'
1022
- * P: ['es6-promise', 'Promise'],
1023
- *
1024
- * // import $ from 'jquery'
1025
- * $: 'jquery',
1026
- *
1027
- * // import * as fs from 'node:fs'
1028
- * fs: ['node:fs', '*'],
1029
- *
1030
- * // Inject shims for property access pattern
1031
- * 'Object.assign': path.resolve( 'src/helpers/object-assign.js' ),
1032
- * }
1033
- * ```
1034
- */
1035
- inject?: Record<string, string | [string, string]>;
1036
- profilerNames?: boolean;
1037
- /**
1038
- * - `false` disables the JSX parser, resulting in a syntax error if JSX syntax is used.
1039
- * - `"preserve"` disables the JSX transformer, preserving the original JSX syntax in the output.
1040
- * - `"react"` enables the `classic` JSX transformer.
1041
- * - `"react-jsx"` enables the `automatic` JSX transformer.
1042
- *
1043
- * @default runtime = "automatic"
1044
- */
1045
- jsx?: false | "react" | "react-jsx" | "preserve";
1046
- transform?: OxcTransformOption;
1047
- watch?: WatcherOptions | false;
1048
- dropLabels?: string[];
1049
- keepNames?: boolean;
1050
- checks?: ChecksOptions;
1051
- makeAbsoluteExternalsRelative?: MakeAbsoluteExternalsRelative;
1052
- debug?: {
1053
- sessionId?: string
1054
- };
1055
- }
1056
-
1057
- //#endregion
1058
- //#region src/types/rolldown-options.d.ts
1059
- interface RolldownOptions extends InputOptions {
1060
- output?: OutputOptions | OutputOptions[];
1061
- }
1062
-
1063
- //#endregion
1064
- //#region src/types/config-export.d.ts
1065
- /**
1066
- * Type for `default export` of `rolldown.config.js` file.
1067
- */
1068
- /**
1069
- * Type for `default export` of `rolldown.config.js` file.
1070
- */
1071
- type ConfigExport = RolldownOptions | RolldownOptions[];
1072
-
1073
- //#endregion
1074
- //#region src/utils/define-config.d.ts
1075
- declare function defineConfig(config: RolldownOptions): RolldownOptions;
1076
- declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
1077
- declare function defineConfig(config: ConfigExport): ConfigExport;
1078
-
1079
- //#endregion
1080
- export { AddonFunction, AsyncPluginHooks, BuildOptions, BuiltinPlugin as BuiltinPlugin$1, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MaybePromise, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION as VERSION$1, WarningHandlerWithDefault, WatchOptions, WatcherOptions, assetPlugin as assetPlugin$1, build as build$1, buildImportAnalysisPlugin as buildImportAnalysisPlugin$1, defineConfig as defineConfig$1, defineParallelPlugin, dynamicImportVarsPlugin as dynamicImportVarsPlugin$1, importGlobPlugin as importGlobPlugin$1, isolatedDeclarationPlugin as isolatedDeclarationPlugin$1, jsonPlugin as jsonPlugin$1, loadFallbackPlugin as loadFallbackPlugin$1, manifestPlugin as manifestPlugin$1, moduleFederationPlugin as moduleFederationPlugin$1, modulePreloadPolyfillPlugin as modulePreloadPolyfillPlugin$1, reporterPlugin as reporterPlugin$1, rolldown as rolldown$1, viteResolvePlugin as viteResolvePlugin$1, wasmFallbackPlugin as wasmFallbackPlugin$1, wasmHelperPlugin as wasmHelperPlugin$1, watch as watch$1, webWorkerPostPlugin as webWorkerPostPlugin$1, withFilter };