rolldown 0.10.1 → 0.10.2

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 (46) hide show
  1. package/dist/chunks/prompt.cjs +6 -1
  2. package/dist/chunks/prompt.cjs.map +1 -1
  3. package/dist/chunks/prompt.mjs +6 -1
  4. package/dist/chunks/prompt.mjs.map +1 -1
  5. package/dist/cli.cjs +7 -2
  6. package/dist/cli.cjs.map +1 -1
  7. package/dist/cli.mjs +7 -2
  8. package/dist/cli.mjs.map +1 -1
  9. package/dist/index.cjs +13 -1
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +10 -1099
  12. package/dist/index.d.mts +10 -1099
  13. package/dist/index.d.ts +10 -1099
  14. package/dist/index.mjs +13 -2
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/parallel-plugin-worker.cjs +34 -0
  17. package/dist/parallel-plugin-worker.cjs.map +1 -0
  18. package/dist/parallel-plugin-worker.d.cts +2 -0
  19. package/dist/parallel-plugin-worker.d.mts +2 -0
  20. package/dist/parallel-plugin-worker.d.ts +2 -0
  21. package/dist/parallel-plugin-worker.mjs +32 -0
  22. package/dist/parallel-plugin-worker.mjs.map +1 -0
  23. package/dist/parallel-plugin.cjs +8 -0
  24. package/dist/parallel-plugin.cjs.map +1 -0
  25. package/dist/parallel-plugin.d.cts +12 -0
  26. package/dist/parallel-plugin.d.mts +12 -0
  27. package/dist/parallel-plugin.d.ts +12 -0
  28. package/dist/parallel-plugin.mjs +6 -0
  29. package/dist/parallel-plugin.mjs.map +1 -0
  30. package/dist/shared/rolldown-binding.wasi.cjs +109 -0
  31. package/dist/shared/rolldown.1ea1dc1e.d.cts +1160 -0
  32. package/dist/shared/rolldown.1ea1dc1e.d.mts +1160 -0
  33. package/dist/shared/rolldown.1ea1dc1e.d.ts +1160 -0
  34. package/dist/shared/rolldown.4d4592d7.cjs +348 -0
  35. package/dist/shared/rolldown.4d4592d7.cjs.map +1 -0
  36. package/dist/shared/{rolldown.ee864e8d.cjs → rolldown.65028ebe.cjs} +126 -307
  37. package/dist/shared/rolldown.65028ebe.cjs.map +1 -0
  38. package/dist/shared/{rolldown.04482f71.mjs → rolldown.7d1ce9fc.mjs} +122 -304
  39. package/dist/shared/rolldown.7d1ce9fc.mjs.map +1 -0
  40. package/dist/shared/rolldown.b914368a.mjs +340 -0
  41. package/dist/shared/rolldown.b914368a.mjs.map +1 -0
  42. package/dist/shared/wasi-worker-browser.mjs +40 -0
  43. package/dist/shared/wasi-worker.mjs +60 -0
  44. package/package.json +41 -21
  45. package/dist/shared/rolldown.04482f71.mjs.map +0 -1
  46. package/dist/shared/rolldown.ee864e8d.cjs.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,7 @@
1
- interface RenderedModule$1 {
1
+ import { I as InputOptions, O as OutputOptions } from './shared/rolldown.1ea1dc1e.js';
2
+ export { D as DefineParallelPluginResult, P as Plugin, d as defineParallelPlugin } from './shared/rolldown.1ea1dc1e.js';
3
+
4
+ interface RenderedModule {
2
5
  }
3
6
 
4
7
  interface RolldownOutputAsset {
@@ -6,12 +9,12 @@ interface RolldownOutputAsset {
6
9
  fileName: string;
7
10
  source: string | Uint8Array;
8
11
  }
9
- interface SourceMap$1 {
12
+ interface SourceMap {
10
13
  file: string;
11
14
  mappings: string;
12
15
  names: string[];
13
16
  sources: string[];
14
- sourcesContent: (string | null)[];
17
+ sourcesContent: string[];
15
18
  version: number;
16
19
  }
17
20
  interface RolldownOutputChunk {
@@ -21,12 +24,12 @@ interface RolldownOutputChunk {
21
24
  exports: string[];
22
25
  fileName: string;
23
26
  modules: {
24
- [id: string]: RenderedModule$1;
27
+ [id: string]: RenderedModule;
25
28
  };
26
29
  facadeModuleId: string | null;
27
30
  isDynamicEntry: boolean;
28
31
  moduleIds: string[];
29
- map: SourceMap$1 | null;
32
+ map: SourceMap | null;
30
33
  sourcemapFileName: string | null;
31
34
  }
32
35
  interface RolldownOutput {
@@ -36,1099 +39,6 @@ interface RolldownOutput {
36
39
  ];
37
40
  }
38
41
 
39
- // utils
40
- type NullValue$1 = null | undefined | void
41
- type MaybePromise$1<T> = T | Promise<T>
42
-
43
- type PartialNull<T> = {
44
- [P in keyof T]: T[P] | null
45
- }
46
-
47
- interface RollupError extends RollupLog {
48
- name?: string
49
- stack?: string
50
- watchFiles?: string[]
51
- }
52
-
53
- interface RollupLog {
54
- binding?: string
55
- cause?: unknown
56
- code?: string
57
- exporter?: string
58
- frame?: string
59
- hook?: string
60
- id?: string
61
- ids?: string[]
62
- loc?: {
63
- column: number
64
- file?: string
65
- line: number
66
- }
67
- message: string
68
- meta?: any
69
- names?: string[]
70
- plugin?: string
71
- pluginCode?: unknown
72
- pos?: number
73
- reexporter?: string
74
- stack?: string
75
- url?: string
76
- }
77
-
78
- type LogLevel = 'warn' | 'info' | 'debug'
79
- type LogLevelOption = LogLevel | 'silent'
80
-
81
- type SourceMapSegment =
82
- | [number]
83
- | [number, number, number, number]
84
- | [number, number, number, number, number]
85
-
86
- interface ExistingDecodedSourceMap {
87
- file?: string
88
- readonly mappings: SourceMapSegment[][]
89
- names: string[]
90
- sourceRoot?: string
91
- sources: string[]
92
- sourcesContent?: (string | null)[]
93
- version: number
94
- x_google_ignoreList?: number[]
95
- }
96
-
97
- interface ExistingRawSourceMap {
98
- file?: string
99
- mappings: string
100
- names: string[]
101
- sourceRoot?: string
102
- sources: string[]
103
- sourcesContent?: (string | null)[]
104
- version: number
105
- x_google_ignoreList?: number[]
106
- }
107
-
108
- type DecodedSourceMapOrMissing =
109
- | {
110
- missing: true
111
- plugin: string
112
- }
113
- | (ExistingDecodedSourceMap & { missing?: false })
114
-
115
- interface SourceMap {
116
- file: string
117
- mappings: string
118
- names: string[]
119
- sources: string[]
120
- sourcesContent: (string | null)[]
121
- version: number
122
- toString(): string
123
- toUrl(): string
124
- }
125
-
126
- type SourceMapInput =
127
- | ExistingRawSourceMap
128
- | string
129
- | null
130
- | { mappings: '' }
131
-
132
- interface ModuleOptions {
133
- assertions: Record<string, string>
134
- meta: CustomPluginOptions
135
- moduleSideEffects: boolean | 'no-treeshake'
136
- syntheticNamedExports: boolean | string
137
- }
138
-
139
- interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
140
- ast?: AcornNode
141
- code: string
142
- map?: SourceMapInput
143
- }
144
-
145
- interface TransformModuleJSON {
146
- ast?: AcornNode
147
- code: string
148
- // note if plugins use new this.cache to opt-out auto transform cache
149
- customTransformCache: boolean
150
- originalCode: string
151
- originalSourcemap: ExistingDecodedSourceMap | null
152
- sourcemapChain: DecodedSourceMapOrMissing[]
153
- transformDependencies: string[]
154
- }
155
-
156
- interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
157
- ast: AcornNode
158
- dependencies: string[]
159
- id: string
160
- resolvedIds: ResolvedIdMap
161
- transformFiles: EmittedFile[] | undefined
162
- }
163
-
164
- interface PluginCache {
165
- delete(id: string): boolean
166
- get<T = any>(id: string): T
167
- has(id: string): boolean
168
- set<T = any>(id: string, value: T): void
169
- }
170
-
171
- type LoggingFunction = (
172
- log: RollupLog | string | (() => RollupLog | string),
173
- ) => void
174
-
175
- interface MinimalPluginContext {
176
- debug: LoggingFunction
177
- error: (error: RollupError | string) => never
178
- info: LoggingFunction
179
- meta: PluginContextMeta
180
- warn: LoggingFunction
181
- }
182
-
183
- interface EmittedAsset {
184
- fileName?: string
185
- name?: string
186
- needsCodeReference?: boolean
187
- source?: string | Uint8Array
188
- type: 'asset'
189
- }
190
-
191
- interface EmittedChunk {
192
- fileName?: string
193
- id: string
194
- implicitlyLoadedAfterOneOf?: string[]
195
- importer?: string
196
- name?: string
197
- preserveSignature?: PreserveEntrySignaturesOption
198
- type: 'chunk'
199
- }
200
-
201
- interface EmittedPrebuiltChunk {
202
- code: string
203
- exports?: string[]
204
- fileName: string
205
- map?: SourceMap
206
- sourcemapFileName?: string
207
- type: 'prebuilt-chunk'
208
- }
209
-
210
- type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk
211
-
212
- type EmitFile = (emittedFile: EmittedFile) => string
213
-
214
- interface ModuleInfo extends ModuleOptions {
215
- ast: AcornNode | null
216
- code: string | null
217
- dynamicImporters: readonly string[]
218
- dynamicallyImportedIdResolutions: readonly ResolvedId[]
219
- dynamicallyImportedIds: readonly string[]
220
- exportedBindings: Record<string, string[]> | null
221
- exports: string[] | null
222
- hasDefaultExport: boolean | null
223
- /** @deprecated Use `moduleSideEffects` instead */
224
- hasModuleSideEffects: boolean | 'no-treeshake'
225
- id: string
226
- implicitlyLoadedAfterOneOf: readonly string[]
227
- implicitlyLoadedBefore: readonly string[]
228
- importedIdResolutions: readonly ResolvedId[]
229
- importedIds: readonly string[]
230
- importers: readonly string[]
231
- isEntry: boolean
232
- isExternal: boolean
233
- isIncluded: boolean | null
234
- }
235
-
236
- type GetModuleInfo = (moduleId: string) => ModuleInfo | null
237
-
238
- interface CustomPluginOptions {
239
- [plugin: string]: any
240
- }
241
-
242
- type LoggingFunctionWithPosition = (
243
- log: RollupLog | string | (() => RollupLog | string),
244
- pos?: number | { column: number; line: number },
245
- ) => void
246
-
247
- interface PluginContext$1 extends MinimalPluginContext {
248
- addWatchFile: (id: string) => void
249
- cache: PluginCache
250
- debug: LoggingFunction
251
- emitFile: EmitFile
252
- error: (error: RollupError | string) => never
253
- getFileName: (fileReferenceId: string) => string
254
- getModuleIds: () => IterableIterator<string>
255
- getModuleInfo: GetModuleInfo
256
- getWatchFiles: () => string[]
257
- info: LoggingFunction
258
- load: (
259
- options: { id: string; resolveDependencies?: boolean } & Partial<
260
- PartialNull<ModuleOptions>
261
- >,
262
- ) => Promise<ModuleInfo>
263
- /** @deprecated Use `this.getModuleIds` instead */
264
- moduleIds: IterableIterator<string>
265
- parse: (input: string, options?: any) => AcornNode
266
- resolve: (
267
- source: string,
268
- importer?: string,
269
- options?: {
270
- assertions?: Record<string, string>
271
- custom?: CustomPluginOptions
272
- isEntry?: boolean
273
- skipSelf?: boolean
274
- },
275
- ) => Promise<ResolvedId | null>
276
- setAssetSource: (
277
- assetReferenceId: string,
278
- source: string | Uint8Array,
279
- ) => void
280
- warn: LoggingFunction
281
- }
282
-
283
- interface PluginContextMeta {
284
- rollupVersion: string
285
- watchMode: boolean
286
- }
287
-
288
- interface ResolvedId extends ModuleOptions {
289
- external: boolean | 'absolute'
290
- id: string
291
- resolvedBy: string
292
- }
293
-
294
- interface ResolvedIdMap {
295
- [key: string]: ResolvedId
296
- }
297
-
298
- interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
299
- external?: boolean | 'absolute' | 'relative'
300
- id: string
301
- resolvedBy?: string
302
- }
303
-
304
- type ResolveIdResult = string | NullValue$1 | false | PartialResolvedId
305
-
306
- type ResolveIdHook = (
307
- this: PluginContext$1,
308
- source: string,
309
- importer: string | undefined,
310
- options: {
311
- assertions: Record<string, string>
312
- custom?: CustomPluginOptions
313
- isEntry: boolean
314
- },
315
- ) => ResolveIdResult
316
-
317
- type ShouldTransformCachedModuleHook = (
318
- this: PluginContext$1,
319
- options: {
320
- ast: AcornNode
321
- code: string
322
- id: string
323
- meta: CustomPluginOptions
324
- moduleSideEffects: boolean | 'no-treeshake'
325
- resolvedSources: ResolvedIdMap
326
- syntheticNamedExports: boolean | string
327
- },
328
- ) => boolean | NullValue$1
329
-
330
- type IsExternal = (
331
- source: string,
332
- importer: string | undefined,
333
- isResolved: boolean,
334
- ) => boolean
335
-
336
- type HasModuleSideEffects = (id: string, external: boolean) => boolean
337
-
338
- type LoadResult = SourceDescription | string | NullValue$1
339
-
340
- type LoadHook = (this: PluginContext$1, id: string) => LoadResult
341
-
342
- interface TransformPluginContext extends PluginContext$1 {
343
- debug: LoggingFunctionWithPosition
344
- error: (
345
- error: RollupError | string,
346
- pos?: number | { column: number; line: number },
347
- ) => never
348
- getCombinedSourcemap: () => SourceMap
349
- info: LoggingFunctionWithPosition
350
- warn: LoggingFunctionWithPosition
351
- }
352
-
353
- type TransformResult = string | NullValue$1 | Partial<SourceDescription>
354
-
355
- type TransformHook = (
356
- this: TransformPluginContext,
357
- code: string,
358
- id: string,
359
- ) => TransformResult
360
-
361
- type ModuleParsedHook = (this: PluginContext$1, info: ModuleInfo) => void
362
-
363
- type RenderChunkHook = (
364
- this: PluginContext$1,
365
- code: string,
366
- chunk: RenderedChunk$1,
367
- options: NormalizedOutputOptions,
368
- meta: { chunks: Record<string, RenderedChunk$1> },
369
- ) => { code: string; map?: SourceMapInput } | string | NullValue$1
370
-
371
- type ResolveDynamicImportHook = (
372
- this: PluginContext$1,
373
- specifier: string | AcornNode,
374
- importer: string,
375
- options: { assertions: Record<string, string> },
376
- ) => ResolveIdResult
377
-
378
- type ResolveImportMetaHook = (
379
- this: PluginContext$1,
380
- property: string | null,
381
- options: { chunkId: string; format: InternalModuleFormat; moduleId: string },
382
- ) => string | NullValue$1
383
-
384
- type ResolveFileUrlHook = (
385
- this: PluginContext$1,
386
- options: {
387
- chunkId: string
388
- fileName: string
389
- format: InternalModuleFormat
390
- moduleId: string
391
- referenceId: string
392
- relativePath: string
393
- },
394
- ) => string | NullValue$1
395
-
396
- type AddonHookFunction = (
397
- this: PluginContext$1,
398
- chunk: RenderedChunk$1,
399
- ) => string | Promise<string>
400
- type AddonHook = string | AddonHookFunction
401
-
402
- type ChangeEvent = 'create' | 'update' | 'delete'
403
- type WatchChangeHook = (
404
- this: PluginContext$1,
405
- id: string,
406
- change: { event: ChangeEvent },
407
- ) => void
408
-
409
- interface OutputBundle {
410
- [fileName: string]: OutputAsset | OutputChunk
411
- }
412
-
413
- interface FunctionPluginHooks {
414
- augmentChunkHash: (this: PluginContext$1, chunk: RenderedChunk$1) => string | void
415
- buildEnd: (this: PluginContext$1, error?: Error) => void
416
- buildStart: (this: PluginContext$1, options: NormalizedInputOptions) => void
417
- closeBundle: (this: PluginContext$1) => void
418
- closeWatcher: (this: PluginContext$1) => void
419
- generateBundle: (
420
- this: PluginContext$1,
421
- options: NormalizedOutputOptions,
422
- bundle: OutputBundle,
423
- isWrite: boolean,
424
- ) => void
425
- load: LoadHook
426
- moduleParsed: ModuleParsedHook
427
- onLog: (
428
- this: MinimalPluginContext,
429
- level: LogLevel,
430
- log: RollupLog,
431
- ) => boolean | NullValue$1
432
- options: (
433
- this: MinimalPluginContext,
434
- options: InputOptions$1,
435
- ) => InputOptions$1 | NullValue$1
436
- outputOptions: (
437
- this: PluginContext$1,
438
- options: OutputOptions$1,
439
- ) => OutputOptions$1 | NullValue$1
440
- renderChunk: RenderChunkHook
441
- renderDynamicImport: (
442
- this: PluginContext$1,
443
- options: {
444
- customResolution: string | null
445
- format: InternalModuleFormat
446
- moduleId: string
447
- targetModuleId: string | null
448
- },
449
- ) => { left: string; right: string } | NullValue$1
450
- renderError: (this: PluginContext$1, error?: Error) => void
451
- renderStart: (
452
- this: PluginContext$1,
453
- outputOptions: NormalizedOutputOptions,
454
- inputOptions: NormalizedInputOptions,
455
- ) => void
456
- resolveDynamicImport: ResolveDynamicImportHook
457
- resolveFileUrl: ResolveFileUrlHook
458
- resolveId: ResolveIdHook
459
- resolveImportMeta: ResolveImportMetaHook
460
- shouldTransformCachedModule: ShouldTransformCachedModuleHook
461
- transform: TransformHook
462
- watchChange: WatchChangeHook
463
- writeBundle: (
464
- this: PluginContext$1,
465
- options: NormalizedOutputOptions,
466
- bundle: OutputBundle,
467
- ) => void
468
- }
469
-
470
- type OutputPluginHooks =
471
- | 'augmentChunkHash'
472
- | 'generateBundle'
473
- | 'outputOptions'
474
- | 'renderChunk'
475
- | 'renderDynamicImport'
476
- | 'renderError'
477
- | 'renderStart'
478
- | 'resolveFileUrl'
479
- | 'resolveImportMeta'
480
- | 'writeBundle'
481
-
482
- type SyncPluginHooks =
483
- | 'augmentChunkHash'
484
- | 'onLog'
485
- | 'outputOptions'
486
- | 'renderDynamicImport'
487
- | 'resolveFileUrl'
488
- | 'resolveImportMeta'
489
-
490
- type AsyncPluginHooks = Exclude<
491
- keyof FunctionPluginHooks,
492
- SyncPluginHooks
493
- >
494
-
495
- type FirstPluginHooks =
496
- | 'load'
497
- | 'renderDynamicImport'
498
- | 'resolveDynamicImport'
499
- | 'resolveFileUrl'
500
- | 'resolveId'
501
- | 'resolveImportMeta'
502
- | 'shouldTransformCachedModule'
503
-
504
- type SequentialPluginHooks =
505
- | 'augmentChunkHash'
506
- | 'generateBundle'
507
- | 'onLog'
508
- | 'options'
509
- | 'outputOptions'
510
- | 'renderChunk'
511
- | 'transform'
512
-
513
- type ParallelPluginHooks = Exclude<
514
- keyof FunctionPluginHooks | AddonHooks,
515
- FirstPluginHooks | SequentialPluginHooks
516
- >
517
-
518
- type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro'
519
-
520
- type MakeAsync<Function_> = Function_ extends (
521
- this: infer This,
522
- ...parameters: infer Arguments
523
- ) => infer Return
524
- ? (this: This, ...parameters: Arguments) => Return | Promise<Return>
525
- : never
526
-
527
- // eslint-disable-next-line @typescript-eslint/ban-types
528
- type ObjectHook<T, O = {}> =
529
- | T
530
- | ({ handler: T; order?: 'pre' | 'post' | null } & O)
531
-
532
- type PluginHooks = {
533
- [K in keyof FunctionPluginHooks]: ObjectHook<
534
- K extends AsyncPluginHooks
535
- ? MakeAsync<FunctionPluginHooks[K]>
536
- : FunctionPluginHooks[K],
537
- // eslint-disable-next-line @typescript-eslint/ban-types
538
- K extends ParallelPluginHooks ? { sequential?: boolean } : {}
539
- >
540
- }
541
-
542
- interface OutputPlugin
543
- extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>,
544
- Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
545
- cacheKey?: string
546
- name: string
547
- version?: string
548
- }
549
-
550
- interface Plugin$1<A = any> extends OutputPlugin, Partial<PluginHooks> {
551
- // for inter-plugin communication
552
- api?: A
553
- }
554
-
555
- type TreeshakingPreset = 'smallest' | 'safest' | 'recommended'
556
-
557
- interface NormalizedTreeshakingOptions {
558
- annotations: boolean
559
- correctVarValueBeforeDeclaration: boolean
560
- manualPureFunctions: readonly string[]
561
- moduleSideEffects: HasModuleSideEffects
562
- propertyReadSideEffects: boolean | 'always'
563
- tryCatchDeoptimization: boolean
564
- unknownGlobalSideEffects: boolean
565
- }
566
-
567
- interface TreeshakingOptions
568
- extends Partial<Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>> {
569
- moduleSideEffects?: ModuleSideEffectsOption
570
- preset?: TreeshakingPreset
571
- }
572
-
573
- interface ManualChunkMeta {
574
- getModuleIds: () => IterableIterator<string>
575
- getModuleInfo: GetModuleInfo
576
- }
577
- type GetManualChunk = (
578
- id: string,
579
- meta: ManualChunkMeta,
580
- ) => string | NullValue$1
581
-
582
- type ExternalOption =
583
- | (string | RegExp)[]
584
- | string
585
- | RegExp
586
- | ((
587
- source: string,
588
- importer: string | undefined,
589
- isResolved: boolean,
590
- ) => boolean | NullValue$1)
591
-
592
- type GlobalsOption =
593
- | { [name: string]: string }
594
- | ((name: string) => string)
595
-
596
- type InputOption = string | string[] | { [entryAlias: string]: string }
597
-
598
- type ManualChunksOption =
599
- | { [chunkAlias: string]: string[] }
600
- | GetManualChunk
601
-
602
- type LogHandlerWithDefault = (
603
- level: LogLevel,
604
- log: RollupLog,
605
- defaultHandler: LogOrStringHandler,
606
- ) => void
607
-
608
- type LogOrStringHandler = (
609
- level: LogLevel | 'error',
610
- log: RollupLog | string,
611
- ) => void
612
-
613
- type LogHandler = (level: LogLevel, log: RollupLog) => void
614
-
615
- type ModuleSideEffectsOption =
616
- | boolean
617
- | 'no-external'
618
- | string[]
619
- | HasModuleSideEffects
620
-
621
- type PreserveEntrySignaturesOption =
622
- | false
623
- | 'strict'
624
- | 'allow-extension'
625
- | 'exports-only'
626
-
627
- type SourcemapPathTransformOption = (
628
- relativeSourcePath: string,
629
- sourcemapPath: string,
630
- ) => string
631
-
632
- type SourcemapIgnoreListOption = (
633
- relativeSourcePath: string,
634
- sourcemapPath: string,
635
- ) => boolean
636
-
637
- type InputPluginOption = MaybePromise$1<
638
- Plugin$1 | NullValue$1 | false | InputPluginOption[]
639
- >
640
-
641
- interface InputOptions$1 {
642
- acorn?: Record<string, unknown>
643
- acornInjectPlugins?:
644
- | ((...arguments_: any[]) => unknown)[]
645
- | ((...arguments_: any[]) => unknown)
646
- cache?: boolean | RollupCache
647
- context?: string
648
- experimentalCacheExpiry?: number
649
- experimentalLogSideEffects?: boolean
650
- external?: ExternalOption
651
- /** @deprecated Use the "inlineDynamicImports" output option instead. */
652
- inlineDynamicImports?: boolean
653
- input?: InputOption
654
- logLevel?: LogLevelOption
655
- makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource'
656
- /** @deprecated Use the "manualChunks" output option instead. */
657
- manualChunks?: ManualChunksOption
658
- maxParallelFileOps?: number
659
- /** @deprecated Use the "maxParallelFileOps" option instead. */
660
- maxParallelFileReads?: number
661
- moduleContext?:
662
- | ((id: string) => string | NullValue$1)
663
- | { [id: string]: string }
664
- onLog?: LogHandlerWithDefault
665
- onwarn?: WarningHandlerWithDefault
666
- perf?: boolean
667
- plugins?: InputPluginOption
668
- preserveEntrySignatures?: PreserveEntrySignaturesOption
669
- /** @deprecated Use the "preserveModules" output option instead. */
670
- preserveModules?: boolean
671
- preserveSymlinks?: boolean
672
- shimMissingExports?: boolean
673
- strictDeprecations?: boolean
674
- treeshake?: boolean | TreeshakingPreset | TreeshakingOptions
675
- watch?: WatcherOptions | false
676
- }
677
-
678
- interface NormalizedInputOptions {
679
- acorn: Record<string, unknown>
680
- acornInjectPlugins: (() => unknown)[]
681
- cache: false | undefined | RollupCache
682
- context: string
683
- experimentalCacheExpiry: number
684
- experimentalLogSideEffects: boolean
685
- external: IsExternal
686
- /** @deprecated Use the "inlineDynamicImports" output option instead. */
687
- inlineDynamicImports: boolean | undefined
688
- input: string[] | { [entryAlias: string]: string }
689
- logLevel: LogLevelOption
690
- makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource'
691
- /** @deprecated Use the "manualChunks" output option instead. */
692
- manualChunks: ManualChunksOption | undefined
693
- maxParallelFileOps: number
694
- /** @deprecated Use the "maxParallelFileOps" option instead. */
695
- maxParallelFileReads: number
696
- moduleContext: (id: string) => string
697
- onLog: LogHandler
698
- onwarn: (warning: RollupLog) => void
699
- perf: boolean
700
- plugins: Plugin$1[]
701
- preserveEntrySignatures: PreserveEntrySignaturesOption
702
- /** @deprecated Use the "preserveModules" output option instead. */
703
- preserveModules: boolean | undefined
704
- preserveSymlinks: boolean
705
- shimMissingExports: boolean
706
- strictDeprecations: boolean
707
- treeshake: false | NormalizedTreeshakingOptions
708
- }
709
-
710
- type InternalModuleFormat =
711
- | 'amd'
712
- | 'cjs'
713
- | 'es'
714
- | 'iife'
715
- | 'system'
716
- | 'umd'
717
-
718
- type ModuleFormat =
719
- | InternalModuleFormat
720
- | 'commonjs'
721
- | 'esm'
722
- | 'module'
723
- | 'systemjs'
724
-
725
- type GeneratedCodePreset = 'es5' | 'es2015'
726
-
727
- interface NormalizedGeneratedCodeOptions {
728
- arrowFunctions: boolean
729
- constBindings: boolean
730
- objectShorthand: boolean
731
- reservedNamesAsProps: boolean
732
- symbols: boolean
733
- }
734
-
735
- interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> {
736
- preset?: GeneratedCodePreset
737
- }
738
-
739
- type OptionsPaths = Record<string, string> | ((id: string) => string)
740
-
741
- type InteropType =
742
- | 'compat'
743
- | 'auto'
744
- | 'esModule'
745
- | 'default'
746
- | 'defaultOnly'
747
-
748
- type GetInterop = (id: string | null) => InteropType
749
-
750
- type AmdOptions = (
751
- | {
752
- autoId?: false
753
- id: string
754
- }
755
- | {
756
- autoId: true
757
- basePath?: string
758
- id?: undefined
759
- }
760
- | {
761
- autoId?: false
762
- id?: undefined
763
- }
764
- ) & {
765
- define?: string
766
- forceJsExtensionForImports?: boolean
767
- }
768
-
769
- type NormalizedAmdOptions = (
770
- | {
771
- autoId: false
772
- id?: string
773
- }
774
- | {
775
- autoId: true
776
- basePath: string
777
- }
778
- ) & {
779
- define: string
780
- forceJsExtensionForImports: boolean
781
- }
782
-
783
- type AddonFunction = (chunk: RenderedChunk$1) => string | Promise<string>
784
-
785
- type OutputPluginOption = MaybePromise$1<
786
- OutputPlugin | NullValue$1 | false | OutputPluginOption[]
787
- >
788
-
789
- interface OutputOptions$1 {
790
- amd?: AmdOptions
791
- assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string)
792
- banner?: string | AddonFunction
793
- chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string)
794
- compact?: boolean
795
- // only required for bundle.write
796
- dir?: string
797
- /** @deprecated Use the "renderDynamicImport" plugin hook instead. */
798
- dynamicImportFunction?: string
799
- dynamicImportInCjs?: boolean
800
- entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string)
801
- esModule?: boolean | 'if-default-prop'
802
- /** @deprecated This option is no longer needed and ignored. */
803
- experimentalDeepDynamicChunkOptimization?: boolean
804
- experimentalMinChunkSize?: number
805
- exports?: 'default' | 'named' | 'none' | 'auto'
806
- extend?: boolean
807
- externalImportAssertions?: boolean
808
- externalLiveBindings?: boolean
809
- // only required for bundle.write
810
- file?: string
811
- footer?: string | AddonFunction
812
- format?: ModuleFormat
813
- freeze?: boolean
814
- generatedCode?: GeneratedCodePreset | GeneratedCodeOptions
815
- globals?: GlobalsOption
816
- hoistTransitiveImports?: boolean
817
- indent?: string | boolean
818
- inlineDynamicImports?: boolean
819
- interop?: InteropType | GetInterop
820
- intro?: string | AddonFunction
821
- manualChunks?: ManualChunksOption
822
- minifyInternalExports?: boolean
823
- name?: string
824
- /** @deprecated Use "generatedCode.symbols" instead. */
825
- namespaceToStringTag?: boolean
826
- noConflict?: boolean
827
- outro?: string | AddonFunction
828
- paths?: OptionsPaths
829
- plugins?: OutputPluginOption
830
- /** @deprecated Use "generatedCode.constBindings" instead. */
831
- preferConst?: boolean
832
- preserveModules?: boolean
833
- preserveModulesRoot?: string
834
- sanitizeFileName?: boolean | ((fileName: string) => string)
835
- sourcemap?: boolean | 'inline' | 'hidden'
836
- sourcemapBaseUrl?: string
837
- sourcemapExcludeSources?: boolean
838
- sourcemapFile?: string
839
- sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string)
840
- sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption
841
- sourcemapPathTransform?: SourcemapPathTransformOption
842
- strict?: boolean
843
- systemNullSetters?: boolean
844
- validate?: boolean
845
- }
846
-
847
- interface NormalizedOutputOptions {
848
- amd: NormalizedAmdOptions
849
- assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string)
850
- banner: AddonFunction
851
- chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string)
852
- compact: boolean
853
- dir: string | undefined
854
- /** @deprecated Use the "renderDynamicImport" plugin hook instead. */
855
- dynamicImportFunction: string | undefined
856
- dynamicImportInCjs: boolean
857
- entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string)
858
- esModule: boolean | 'if-default-prop'
859
- /** @deprecated This option is no longer needed and ignored. */
860
- experimentalDeepDynamicChunkOptimization: boolean
861
- experimentalMinChunkSize: number
862
- exports: 'default' | 'named' | 'none' | 'auto'
863
- extend: boolean
864
- externalImportAssertions: boolean
865
- externalLiveBindings: boolean
866
- file: string | undefined
867
- footer: AddonFunction
868
- format: InternalModuleFormat
869
- freeze: boolean
870
- generatedCode: NormalizedGeneratedCodeOptions
871
- globals: GlobalsOption
872
- hoistTransitiveImports: boolean
873
- indent: true | string
874
- inlineDynamicImports: boolean
875
- interop: GetInterop
876
- intro: AddonFunction
877
- manualChunks: ManualChunksOption
878
- minifyInternalExports: boolean
879
- name: string | undefined
880
- /** @deprecated Use "generatedCode.symbols" instead. */
881
- namespaceToStringTag: boolean
882
- noConflict: boolean
883
- outro: AddonFunction
884
- paths: OptionsPaths
885
- plugins: OutputPlugin[]
886
- /** @deprecated Use "generatedCode.constBindings" instead. */
887
- preferConst: boolean
888
- preserveModules: boolean
889
- preserveModulesRoot: string | undefined
890
- sanitizeFileName: (fileName: string) => string
891
- sourcemap: boolean | 'inline' | 'hidden'
892
- sourcemapBaseUrl: string | undefined
893
- sourcemapExcludeSources: boolean
894
- sourcemapFile: string | undefined
895
- sourcemapFileNames:
896
- | string
897
- | ((chunkInfo: PreRenderedChunk) => string)
898
- | undefined
899
- sourcemapIgnoreList: SourcemapIgnoreListOption
900
- sourcemapPathTransform: SourcemapPathTransformOption | undefined
901
- strict: boolean
902
- systemNullSetters: boolean
903
- validate: boolean
904
- }
905
-
906
- type WarningHandlerWithDefault = (
907
- warning: RollupLog,
908
- defaultHandler: LoggingFunction,
909
- ) => void
910
-
911
- interface PreRenderedAsset {
912
- name: string | undefined
913
- source: string | Uint8Array
914
- type: 'asset'
915
- }
916
-
917
- interface OutputAsset extends PreRenderedAsset {
918
- fileName: string
919
- needsCodeReference: boolean
920
- }
921
-
922
- interface RenderedModule {
923
- readonly code: string | null
924
- originalLength: number
925
- removedExports: string[]
926
- renderedExports: string[]
927
- renderedLength: number
928
- }
929
-
930
- interface PreRenderedChunk {
931
- exports: string[]
932
- facadeModuleId: string | null
933
- isDynamicEntry: boolean
934
- isEntry: boolean
935
- isImplicitEntry: boolean
936
- moduleIds: string[]
937
- name: string
938
- type: 'chunk'
939
- }
940
-
941
- interface RenderedChunk$1 extends PreRenderedChunk {
942
- dynamicImports: string[]
943
- fileName: string
944
- implicitlyLoadedBefore: string[]
945
- importedBindings: {
946
- [imported: string]: string[]
947
- }
948
- imports: string[]
949
- modules: {
950
- [id: string]: RenderedModule
951
- }
952
- referencedFiles: string[]
953
- }
954
-
955
- interface OutputChunk extends RenderedChunk$1 {
956
- code: string
957
- map: SourceMap | null
958
- sourcemapFileName: string | null
959
- preliminaryFileName: string
960
- }
961
-
962
- interface SerializablePluginCache {
963
- [key: string]: [number, any]
964
- }
965
-
966
- interface RollupCache {
967
- modules: ModuleJSON[]
968
- plugins?: Record<string, SerializablePluginCache>
969
- }
970
-
971
- interface ChokidarOptions {
972
- alwaysStat?: boolean
973
- atomic?: boolean | number
974
- awaitWriteFinish?:
975
- | {
976
- pollInterval?: number
977
- stabilityThreshold?: number
978
- }
979
- | boolean
980
- binaryInterval?: number
981
- cwd?: string
982
- depth?: number
983
- disableGlobbing?: boolean
984
- followSymlinks?: boolean
985
- ignoreInitial?: boolean
986
- ignorePermissionErrors?: boolean
987
- ignored?: any
988
- interval?: number
989
- persistent?: boolean
990
- useFsEvents?: boolean
991
- usePolling?: boolean
992
- }
993
-
994
- interface WatcherOptions {
995
- buildDelay?: number
996
- chokidar?: ChokidarOptions
997
- clearScreen?: boolean
998
- exclude?: string | RegExp | (string | RegExp)[]
999
- include?: string | RegExp | (string | RegExp)[]
1000
- skipWrite?: boolean
1001
- }
1002
-
1003
- interface AcornNode {
1004
- end: number
1005
- start: number
1006
- type: string
1007
- }
1008
-
1009
- declare class BindingOutputAsset {
1010
- get fileName(): string
1011
- get source(): string
1012
- }
1013
-
1014
- declare class BindingOutputChunk {
1015
- get isEntry(): boolean
1016
- get isDynamicEntry(): boolean
1017
- get facadeModuleId(): string | null
1018
- get moduleIds(): Array<string>
1019
- get exports(): Array<string>
1020
- get fileName(): string
1021
- get modules(): Record<string, BindingRenderedModule>
1022
- get code(): string
1023
- get map(): string | null
1024
- get sourcemapFileName(): string | null
1025
- }
1026
-
1027
- declare class BindingOutputs {
1028
- get chunks(): Array<BindingOutputChunk>
1029
- get assets(): Array<BindingOutputAsset>
1030
- }
1031
-
1032
- declare class BindingPluginContext {
1033
- resolve(
1034
- specifier: string,
1035
- importer: string | undefined | null,
1036
- extraOptions: BindingPluginContextResolveOptions,
1037
- ): void
1038
- }
1039
-
1040
- interface BindingHookResolveIdExtraOptions {
1041
- isEntry: boolean
1042
- kind: string
1043
- }
1044
-
1045
- interface BindingPluginContextResolveOptions {
1046
- importKind: string
1047
- }
1048
-
1049
- interface BindingRenderedModule {
1050
- code?: string
1051
- }
1052
-
1053
- interface BindingResolveOptions {
1054
- alias?: Record<string, Array<string>>
1055
- aliasFields?: Array<Array<string>>
1056
- conditionNames?: Array<string>
1057
- exportsFields?: Array<Array<string>>
1058
- extensions?: Array<string>
1059
- mainFields?: Array<string>
1060
- mainFiles?: Array<string>
1061
- modules?: Array<string>
1062
- symlinks?: boolean
1063
- }
1064
-
1065
- interface RenderedChunk {
1066
- isEntry: boolean
1067
- isDynamicEntry: boolean
1068
- facadeModuleId?: string
1069
- moduleIds: Array<string>
1070
- exports: Array<string>
1071
- fileName: string
1072
- modules: Record<string, BindingRenderedModule>
1073
- }
1074
-
1075
- interface AnyFn {
1076
- (...args: any[]): any;
1077
- }
1078
- interface AnyObj {
1079
- }
1080
- type NullValue<T = void> = T | undefined | null | void;
1081
-
1082
- type MaybePromise<T> = T | Promise<T>;
1083
- type PluginContext = BindingPluginContext;
1084
- type FormalHook<Handler extends AnyFn, HookOptions extends AnyObj = AnyObj> = {
1085
- handler: Handler;
1086
- } & HookOptions;
1087
- type Hook<Handler extends AnyFn, HookOptions extends AnyObj = AnyObj> = FormalHook<Handler, HookOptions> | Handler;
1088
- interface Plugin {
1089
- name?: string;
1090
- buildStart?: Hook<(this: PluginContext, options: RolldownNormalizedInputOptions) => MaybePromise<NullValue>>;
1091
- resolveId?: Hook<(this: null, source: string, importer: string | undefined, extraOptions: BindingHookResolveIdExtraOptions) => MaybePromise<string | NullValue | false | {
1092
- id: string;
1093
- external?: boolean;
1094
- }>>;
1095
- load?: Hook<(this: null, id: string) => MaybePromise<NullValue | string | {
1096
- code: string;
1097
- map?: string | null;
1098
- }>>;
1099
- transform?: Hook<(this: null, code: string, id: string) => MaybePromise<NullValue | string | {
1100
- code: string;
1101
- map?: string | null;
1102
- }>>;
1103
- renderChunk?: Hook<(this: null, code: string, chunk: RenderedChunk) => MaybePromise<NullValue | string>>;
1104
- buildEnd?: Hook<(this: null, err?: string) => MaybePromise<NullValue>>;
1105
- generateBundle?: Hook<(bundle: BindingOutputs, isWrite: boolean) => MaybePromise<NullValue>>;
1106
- writeBundle?: Hook<(bundle: BindingOutputs) => MaybePromise<NullValue>>;
1107
- }
1108
-
1109
- interface InputOptions {
1110
- input?: InputOptions$1['input'];
1111
- plugins?: Plugin[];
1112
- external?: InputOptions$1['external'];
1113
- resolve?: RolldownResolveOptions;
1114
- cwd?: string;
1115
- }
1116
- type RolldownResolveOptions = Omit<BindingResolveOptions, 'alias'> & {
1117
- alias?: Record<string, string>;
1118
- };
1119
- type RolldownNormalizedInputOptions = NormalizedInputOptions & {
1120
- resolve?: BindingResolveOptions;
1121
- };
1122
-
1123
- interface OutputOptions {
1124
- dir?: OutputOptions$1['dir'];
1125
- format?: 'es';
1126
- exports?: OutputOptions$1['exports'];
1127
- sourcemap?: OutputOptions$1['sourcemap'];
1128
- banner?: OutputOptions$1['banner'];
1129
- footer?: OutputOptions$1['footer'];
1130
- }
1131
-
1132
42
  interface RolldownOptions extends InputOptions {
1133
43
  output?: OutputOptions;
1134
44
  }
@@ -1142,6 +52,7 @@ declare class RolldownBuild {
1142
52
  constructor(inputOptions: InputOptions);
1143
53
  generate(outputOptions?: OutputOptions): Promise<RolldownOutput>;
1144
54
  write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
55
+ destroy(): Promise<void>;
1145
56
  }
1146
57
 
1147
58
  declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
@@ -1152,4 +63,4 @@ declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
1152
63
  */
1153
64
  declare const experimental_scan: (input: InputOptions) => Promise<void>;
1154
65
 
1155
- export { type InputOptions, type OutputOptions, type Plugin, type RolldownOptions, type RolldownOutput, type RolldownOutputChunk, type RolldownOptions as RollupOptions, type RolldownOutput as RollupOutput, defineConfig, experimental_scan, rolldown };
66
+ export { InputOptions, OutputOptions, type RolldownOptions, type RolldownOutput, type RolldownOutputChunk, type RolldownOptions as RollupOptions, type RolldownOutput as RollupOutput, defineConfig, experimental_scan, rolldown };