@rolldown/browser 1.0.0-beta.7-commit.46fbc61 → 1.0.0-beta.7-commit.a684277

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