rolldown 1.0.0-beta.3-commit.e170e6e → 1.0.0-beta.30

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 (149) hide show
  1. package/bin/cli.mjs +2 -0
  2. package/dist/{cjs/cli.cjs → cli.cjs} +620 -620
  3. package/dist/cli.d.cts +1 -0
  4. package/dist/cli.d.mts +1 -0
  5. package/dist/{esm/cli.mjs → cli.mjs} +596 -593
  6. package/dist/config.cjs +12 -0
  7. package/dist/config.d.cts +10 -0
  8. package/dist/config.d.mts +10 -0
  9. package/dist/config.mjs +10 -0
  10. package/dist/experimental-index.cjs +105 -0
  11. package/dist/experimental-index.d.cts +58 -0
  12. package/dist/experimental-index.d.mts +58 -0
  13. package/dist/experimental-index.mjs +82 -0
  14. package/dist/experimental-runtime-types.d.ts +66 -0
  15. package/dist/filter-index.cjs +105 -0
  16. package/dist/filter-index.d.cts +4 -0
  17. package/dist/filter-index.d.mts +4 -0
  18. package/dist/filter-index.mjs +44 -0
  19. package/dist/index.cjs +9 -0
  20. package/dist/index.d.cts +3 -0
  21. package/dist/index.d.mts +3 -0
  22. package/dist/index.mjs +5 -0
  23. package/dist/{cjs/parallel-plugin-worker.cjs → parallel-plugin-worker.cjs} +6 -15
  24. package/dist/parallel-plugin-worker.d.cts +1 -0
  25. package/dist/parallel-plugin-worker.d.mts +1 -0
  26. package/dist/{esm/parallel-plugin-worker.mjs → parallel-plugin-worker.mjs} +5 -13
  27. package/dist/{cjs/parallel-plugin.cjs → parallel-plugin.cjs} +1 -2
  28. package/dist/parallel-plugin.d.cts +14 -0
  29. package/dist/parallel-plugin.d.mts +14 -0
  30. package/dist/{esm/parallel-plugin.mjs → parallel-plugin.mjs} +0 -1
  31. package/dist/parse-ast-index.cjs +4 -0
  32. package/dist/parse-ast-index.d.cts +8 -0
  33. package/dist/parse-ast-index.d.mts +8 -0
  34. package/dist/parse-ast-index.mjs +3 -0
  35. package/dist/shared/binding-BAyrv67G.d.cts +1309 -0
  36. package/dist/shared/binding-DUz1Q2JW.d.mts +1309 -0
  37. package/dist/shared/{chunk-qZFfknuJ.cjs → chunk-DDkG_k5U.cjs} +0 -1
  38. package/dist/shared/define-config-CMH1jWhX.d.cts +1331 -0
  39. package/dist/shared/define-config-D_KKKWbo.d.mts +1331 -0
  40. package/dist/shared/load-config-BWjPkvnW.mjs +119 -0
  41. package/dist/shared/load-config-BtTrX40c.cjs +125 -0
  42. package/dist/shared/misc-CQeo-AFx.mjs +22 -0
  43. package/dist/shared/misc-DksvspN4.cjs +58 -0
  44. package/dist/shared/parse-ast-index-DrqwhzH4.cjs +784 -0
  45. package/dist/shared/parse-ast-index-DyFjvjrb.mjs +656 -0
  46. package/dist/shared/{prompt-CxK9euq3.mjs → prompt-C5jz26Zn.mjs} +241 -240
  47. package/dist/shared/{prompt-ZZScCEWI.cjs → prompt-QNI93ne7.cjs} +245 -245
  48. package/dist/shared/src-CRRyjCYJ.cjs +4573 -0
  49. package/dist/shared/src-DR2upIfp.mjs +4381 -0
  50. package/package.json +69 -69
  51. package/bin/cli.js +0 -2
  52. package/dist/cjs/experimental-index.cjs +0 -85
  53. package/dist/cjs/index.cjs +0 -8
  54. package/dist/cjs/parse-ast-index.cjs +0 -4
  55. package/dist/esm/experimental-index.mjs +0 -57
  56. package/dist/esm/index.mjs +0 -4
  57. package/dist/esm/parse-ast-index.mjs +0 -3
  58. package/dist/shared/parse-ast-index-DIxeQDpE.mjs +0 -674
  59. package/dist/shared/parse-ast-index-Dh_sWnMa.cjs +0 -719
  60. package/dist/shared/src-CLo-BgXK.cjs +0 -3007
  61. package/dist/shared/src-CTS_IQ3m.mjs +0 -2826
  62. package/dist/types/api/build.d.ts +0 -18
  63. package/dist/types/api/experimental.d.ts +0 -7
  64. package/dist/types/api/rolldown/index.d.ts +0 -3
  65. package/dist/types/api/rolldown/rolldown-build.d.ts +0 -13
  66. package/dist/types/api/watch/index.d.ts +0 -3
  67. package/dist/types/api/watch/watch-emitter.d.ts +0 -31
  68. package/dist/types/api/watch/watcher.d.ts +0 -13
  69. package/dist/types/binding.d.ts +0 -1435
  70. package/dist/types/builtin-plugin/alias-plugin.d.ts +0 -10
  71. package/dist/types/builtin-plugin/constructors.d.ts +0 -21
  72. package/dist/types/builtin-plugin/replace-plugin.d.ts +0 -28
  73. package/dist/types/builtin-plugin/transform-plugin.d.ts +0 -9
  74. package/dist/types/builtin-plugin/utils.d.ts +0 -8
  75. package/dist/types/cli/arguments/alias.d.ts +0 -16
  76. package/dist/types/cli/arguments/index.d.ts +0 -15
  77. package/dist/types/cli/arguments/normalize.d.ts +0 -12
  78. package/dist/types/cli/arguments/utils.d.ts +0 -8
  79. package/dist/types/cli/colors.d.ts +0 -11
  80. package/dist/types/cli/commands/bundle.d.ts +0 -3
  81. package/dist/types/cli/commands/help.d.ts +0 -1
  82. package/dist/types/cli/index.d.ts +0 -1
  83. package/dist/types/cli/load-config.d.ts +0 -5
  84. package/dist/types/cli/logger.d.ts +0 -5
  85. package/dist/types/constants/plugin-context.d.ts +0 -7
  86. package/dist/types/constants/plugin.d.ts +0 -45
  87. package/dist/types/experimental-index.d.ts +0 -9
  88. package/dist/types/index.d.ts +0 -30
  89. package/dist/types/log/log-handler.d.ts +0 -4
  90. package/dist/types/log/logger.d.ts +0 -6
  91. package/dist/types/log/logging.d.ts +0 -12
  92. package/dist/types/log/logs.d.ts +0 -18
  93. package/dist/types/options/input-options.d.ts +0 -181
  94. package/dist/types/options/normalized-input-options.d.ts +0 -18
  95. package/dist/types/options/normalized-output-options.d.ts +0 -70
  96. package/dist/types/options/output-options.d.ts +0 -182
  97. package/dist/types/options/watch-options.d.ts +0 -5
  98. package/dist/types/parallel-plugin-worker.d.ts +0 -1
  99. package/dist/types/parallel-plugin.d.ts +0 -1
  100. package/dist/types/parse-ast-index.d.ts +0 -5
  101. package/dist/types/plugin/bindingify-build-hooks.d.ts +0 -10
  102. package/dist/types/plugin/bindingify-hook-filter.d.ts +0 -7
  103. package/dist/types/plugin/bindingify-output-hooks.d.ts +0 -14
  104. package/dist/types/plugin/bindingify-plugin-hook-meta.d.ts +0 -8
  105. package/dist/types/plugin/bindingify-plugin.d.ts +0 -16
  106. package/dist/types/plugin/bindingify-watch-hooks.d.ts +0 -5
  107. package/dist/types/plugin/hook-filter.d.ts +0 -48
  108. package/dist/types/plugin/index.d.ts +0 -134
  109. package/dist/types/plugin/minimal-plugin-context.d.ts +0 -23
  110. package/dist/types/plugin/parallel-plugin-implementation.d.ts +0 -10
  111. package/dist/types/plugin/parallel-plugin.d.ts +0 -9
  112. package/dist/types/plugin/plugin-context-data.d.ts +0 -17
  113. package/dist/types/plugin/plugin-context.d.ts +0 -67
  114. package/dist/types/plugin/plugin-driver.d.ts +0 -8
  115. package/dist/types/plugin/transform-plugin-context.d.ts +0 -28
  116. package/dist/types/types/assert.d.ts +0 -14
  117. package/dist/types/types/config-export.d.ts +0 -5
  118. package/dist/types/types/misc.d.ts +0 -40
  119. package/dist/types/types/module-info.d.ts +0 -15
  120. package/dist/types/types/module-side-effects.d.ts +0 -12
  121. package/dist/types/types/output-bundle.d.ts +0 -4
  122. package/dist/types/types/rolldown-options.d.ts +0 -5
  123. package/dist/types/types/rolldown-output.d.ts +0 -66
  124. package/dist/types/types/schema.d.ts +0 -33
  125. package/dist/types/types/sourcemap.d.ts +0 -14
  126. package/dist/types/types/utils.d.ts +0 -13
  127. package/dist/types/utils/asset-source.d.ts +0 -4
  128. package/dist/types/utils/async-flatten.d.ts +0 -1
  129. package/dist/types/utils/bindingify-input-options.d.ts +0 -7
  130. package/dist/types/utils/bindingify-output-options.d.ts +0 -5
  131. package/dist/types/utils/code-frame.d.ts +0 -1
  132. package/dist/types/utils/compose-js-plugins.d.ts +0 -2
  133. package/dist/types/utils/create-bundler-option.d.ts +0 -11
  134. package/dist/types/utils/create-bundler.d.ts +0 -8
  135. package/dist/types/utils/define-config.d.ts +0 -5
  136. package/dist/types/utils/error.d.ts +0 -2
  137. package/dist/types/utils/initialize-parallel-plugins.d.ts +0 -19
  138. package/dist/types/utils/misc.d.ts +0 -6
  139. package/dist/types/utils/normalize-hook.d.ts +0 -7
  140. package/dist/types/utils/normalize-plugin-option.d.ts +0 -13
  141. package/dist/types/utils/normalize-string-or-regex.d.ts +0 -2
  142. package/dist/types/utils/plugin/index.d.ts +0 -2
  143. package/dist/types/utils/transform-module-info.d.ts +0 -4
  144. package/dist/types/utils/transform-rendered-chunk.d.ts +0 -4
  145. package/dist/types/utils/transform-rendered-module.d.ts +0 -3
  146. package/dist/types/utils/transform-side-effects.d.ts +0 -3
  147. package/dist/types/utils/transform-sourcemap.d.ts +0 -3
  148. package/dist/types/utils/transform-to-rollup-output.d.ts +0 -11
  149. package/dist/types/utils/validator.d.ts +0 -6
@@ -0,0 +1,1331 @@
1
+ import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMinifyOptions, BindingModulePreloadPolyfillPluginConfig, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-DUz1Q2JW.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
+ //#endregion
41
+ //#region src/types/misc.d.ts
42
+ type SourcemapPathTransformOption = (relativeSourcePath: string, sourcemapPath: string) => string;
43
+ type SourcemapIgnoreListOption = (relativeSourcePath: string, sourcemapPath: string) => boolean;
44
+ //#endregion
45
+ //#region src/types/module-info.d.ts
46
+ interface ModuleInfo extends ModuleOptions {
47
+ /**
48
+ * Unsupported at rolldown
49
+ */
50
+ ast: any;
51
+ code: string | null;
52
+ id: string;
53
+ importers: string[];
54
+ dynamicImporters: string[];
55
+ importedIds: string[];
56
+ dynamicallyImportedIds: string[];
57
+ exports: string[];
58
+ isEntry: boolean;
59
+ }
60
+ //#endregion
61
+ //#region src/utils/asset-source.d.ts
62
+ type AssetSource = string | Uint8Array;
63
+ //#endregion
64
+ //#region src/types/rolldown-output.d.ts
65
+ interface OutputAsset {
66
+ type: "asset";
67
+ fileName: string;
68
+ /** @deprecated Use "originalFileNames" instead. */
69
+ originalFileName: string | null;
70
+ originalFileNames: string[];
71
+ source: AssetSource;
72
+ /** @deprecated Use "names" instead. */
73
+ name: string | undefined;
74
+ names: string[];
75
+ }
76
+ interface SourceMap {
77
+ file: string;
78
+ mappings: string;
79
+ names: string[];
80
+ sources: string[];
81
+ sourcesContent: string[];
82
+ version: number;
83
+ debugId?: string;
84
+ x_google_ignoreList?: number[];
85
+ toString(): string;
86
+ toUrl(): string;
87
+ }
88
+ interface RenderedModule {
89
+ readonly code: string | null;
90
+ renderedLength: number;
91
+ renderedExports: string[];
92
+ }
93
+ interface RenderedChunk extends Omit<BindingRenderedChunk, "modules"> {
94
+ type: "chunk";
95
+ modules: {
96
+ [id: string]: RenderedModule;
97
+ };
98
+ name: string;
99
+ isEntry: boolean;
100
+ isDynamicEntry: boolean;
101
+ facadeModuleId: string | null;
102
+ moduleIds: Array<string>;
103
+ exports: Array<string>;
104
+ fileName: string;
105
+ imports: Array<string>;
106
+ dynamicImports: Array<string>;
107
+ }
108
+ interface OutputChunk {
109
+ type: "chunk";
110
+ code: string;
111
+ name: string;
112
+ isEntry: boolean;
113
+ exports: string[];
114
+ fileName: string;
115
+ modules: {
116
+ [id: string]: RenderedModule;
117
+ };
118
+ imports: string[];
119
+ dynamicImports: string[];
120
+ facadeModuleId: string | null;
121
+ isDynamicEntry: boolean;
122
+ moduleIds: string[];
123
+ map: SourceMap | null;
124
+ sourcemapFileName: string | null;
125
+ preliminaryFileName: string;
126
+ }
127
+ interface RolldownOutput {
128
+ output: [OutputChunk, ...(OutputChunk | OutputAsset)[]];
129
+ }
130
+ //#endregion
131
+ //#region src/types/utils.d.ts
132
+ type MaybePromise<T> = T | Promise<T>;
133
+ type NullValue<T = void> = T | undefined | null | void;
134
+ type PartialNull<T> = { [P in keyof T]: T[P] | null };
135
+ type MakeAsync<Function_> = Function_ extends ((this: infer This, ...parameters: infer Arguments) => infer Return) ? (this: This, ...parameters: Arguments) => Return | Promise<Return> : never;
136
+ type MaybeArray<T> = T | T[];
137
+ type StringOrRegExp = string | RegExp;
138
+ //#endregion
139
+ //#region src/options/output-options.d.ts
140
+ type ModuleFormat = "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd";
141
+ type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
142
+ type ChunkFileNamesFunction = (chunkInfo: PreRenderedChunk) => string;
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 MinifyOptions = BindingMinifyOptions;
152
+ interface ChunkingContext {
153
+ getModuleInfo(moduleId: string): ModuleInfo | null;
154
+ }
155
+ interface OutputOptions {
156
+ dir?: string;
157
+ file?: string;
158
+ exports?: "auto" | "named" | "default" | "none";
159
+ hashCharacters?: "base64" | "base36" | "hex";
160
+ /**
161
+ * Expected format of generated code.
162
+ * - `'es'`, `'esm'` and `'module'` are the same format, all stand for ES module.
163
+ * - `'cjs'` and `'commonjs'` are the same format, all stand for CommonJS module.
164
+ * - `'iife'` stands for [Immediately Invoked Function Expression](https://developer.mozilla.org/en-US/docs/Glossary/IIFE).
165
+ * - `'umd'` stands for [Universal Module Definition](https://github.com/umdjs/umd).
166
+ *
167
+ * @default 'esm'
168
+ */
169
+ format?: ModuleFormat;
170
+ sourcemap?: boolean | "inline" | "hidden";
171
+ sourcemapBaseUrl?: string;
172
+ sourcemapDebugIds?: boolean;
173
+ sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
174
+ sourcemapPathTransform?: SourcemapPathTransformOption;
175
+ banner?: string | AddonFunction;
176
+ footer?: string | AddonFunction;
177
+ intro?: string | AddonFunction;
178
+ outro?: string | AddonFunction;
179
+ extend?: boolean;
180
+ esModule?: boolean | "if-default-prop";
181
+ assetFileNames?: string | AssetFileNamesFunction;
182
+ entryFileNames?: string | ChunkFileNamesFunction;
183
+ chunkFileNames?: string | ChunkFileNamesFunction;
184
+ cssEntryFileNames?: string | ChunkFileNamesFunction;
185
+ cssChunkFileNames?: string | ChunkFileNamesFunction;
186
+ sanitizeFileName?: boolean | ((name: string) => string);
187
+ minify?: boolean | "dce-only" | MinifyOptions;
188
+ name?: string;
189
+ globals?: Record<string, string> | GlobalsFunction;
190
+ externalLiveBindings?: boolean;
191
+ inlineDynamicImports?: boolean;
192
+ /**
193
+ * - Type: `((moduleId: string, meta: { getModuleInfo: (moduleId: string) => ModuleInfo | null }) => string | NullValue)`
194
+ * - Object form is not supported.
195
+ *
196
+ * :::warning
197
+ * - This option is deprecated. Please use `advancedChunks` instead.
198
+ * - If `manualChunks` and `advancedChunks` are both specified, `manualChunks` option will be ignored.
199
+ * :::
200
+ *
201
+ * You could use this option for migration purpose. Under the hood,
202
+ *
203
+ * ```js
204
+ * {
205
+ * manualChunks: (moduleId, meta) => {
206
+ * if (moduleId.includes('node_modules')) {
207
+ * return 'vendor';
208
+ * }
209
+ * return null;
210
+ * }
211
+ * }
212
+ * ```
213
+ *
214
+ * will be transformed to
215
+ *
216
+ * ```js
217
+ * {
218
+ * advancedChunks: {
219
+ * groups: [
220
+ * {
221
+ * name(moduleId) {
222
+ * if (moduleId.includes('node_modules')) {
223
+ * return 'vendor';
224
+ * }
225
+ * return null;
226
+ * },
227
+ * },
228
+ * ],
229
+ * }
230
+ * }
231
+ *
232
+ * ```
233
+ *
234
+ * @deprecated Please use `advancedChunks` instead.
235
+ */
236
+ manualChunks?: (moduleId: string, meta: {
237
+ getModuleInfo: (moduleId: string) => ModuleInfo | null;
238
+ }) => string | NullValue;
239
+ /**
240
+ * Allows you to do manual chunking. For deeper understanding, please refer to the in-depth [documentation](https://rolldown.rs/guide/in-depth/advanced-chunks).
241
+ */
242
+ advancedChunks?: {
243
+ /**
244
+ * - Type: `number`
245
+ *
246
+ * Global fallback of [`{group}.minSize`](#advancedchunks-groups-minsize), if it's not specified in the group.
247
+ */
248
+ minSize?: number;
249
+ /**
250
+ * - Type: `number`
251
+ *
252
+ * Global fallback of [`{group}.maxSize`](#advancedchunks-groups-maxsize), if it's not specified in the group.
253
+ */
254
+ maxSize?: number;
255
+ /**
256
+ * - Type: `number`
257
+ *
258
+ * Global fallback of [`{group}.maxModuleSize`](#advancedchunks-groups-maxmodulesize), if it's not specified in the group.
259
+ */
260
+ maxModuleSize?: number;
261
+ /**
262
+ * - Type: `number`
263
+ *
264
+ * Global fallback of [`{group}.minModuleSize`](#advancedchunks-groups-minmodulesize), if it's not specified in the group.
265
+ */
266
+ minModuleSize?: number;
267
+ /**
268
+ * - Type: `number`
269
+ *
270
+ * Global fallback of [`{group}.minShareCount`](#advancedchunks-groups-minsharecount), if it's not specified in the group.
271
+ */
272
+ minShareCount?: number;
273
+ /**
274
+ * Groups to be used for advanced chunking.
275
+ */
276
+ groups?: {
277
+ /**
278
+ * - Type: `string | ((moduleId: string, ctx: { getModuleInfo: (moduleId: string) => ModuleInfo | null }) => string | NullValue)`
279
+ *
280
+ * Name of the group. It will be also used as the name of the chunk and replaced the `[name]` placeholder in the `chunkFileNames` option.
281
+ *
282
+ * For example,
283
+ *
284
+ * ```js
285
+ * import { defineConfig } from 'rolldown';
286
+ *
287
+ * export default defineConfig({
288
+ * advancedChunks: {
289
+ * groups: [
290
+ * {
291
+ * name: 'libs',
292
+ * test: /node_modules/,
293
+ * },
294
+ * ],
295
+ * },
296
+ * });
297
+ * ```
298
+ * will create a chunk named `libs-[hash].js` in the end.
299
+ *
300
+ * It's ok to have the same name for different groups. Rolldown will deduplicate the chunk names if necessary.
301
+ *
302
+ * # Dynamic `name()`
303
+ *
304
+ * If `name` is a function, it will be called with the module id as the argument. The function should return a string or `null`. If it returns `null`, the module will be ignored by this group.
305
+ *
306
+ * Notice, each returned new name will be treated as a separate group.
307
+ *
308
+ * For example,
309
+ *
310
+ * ```js
311
+ * import { defineConfig } from 'rolldown';
312
+ *
313
+ * export default defineConfig({
314
+ * advancedChunks: {
315
+ * groups: [
316
+ * {
317
+ * name: (moduleId) => moduleId.includes('node_modules') ? 'libs' : 'app',
318
+ * minSize: 100 * 1024,
319
+ * },
320
+ * ],
321
+ * },
322
+ * });
323
+ * ```
324
+ *
325
+ * :::warning
326
+ * Constraints like `minSize`, `maxSize`, etc. are applied separately for different names returned by the function.
327
+ * :::
328
+ */
329
+ name: string | ((moduleId: string, ctx: ChunkingContext) => string | NullValue);
330
+ /**
331
+ * - Type: `string | RegExp | ((id: string) => boolean | undefined | void);`
332
+ *
333
+ * Controls which modules are captured in this group.
334
+ *
335
+ * - If `test` is a string, the module whose id contains the string will be captured.
336
+ * - If `test` is a regular expression, the module whose id matches the regular expression will be captured.
337
+ * - If `test` is a function, modules for which `test(id)` returns `true` will be captured.
338
+ * - If `test` is empty, any module will be considered as matched.
339
+ *
340
+ * :::warning
341
+ * When using regular expression, it's recommended to use `[\\/]` to match the path separator instead of `/` to avoid potential issues on Windows.
342
+ * - ✅ Recommended: `/node_modules[\\/]react/`
343
+ * - ❌ Not recommended: `/node_modules/react/`
344
+ * :::
345
+ */
346
+ test?: StringOrRegExp | ((id: string) => boolean | undefined | void);
347
+ /**
348
+ * - Type: `number`
349
+ * - Default: `0`
350
+ *
351
+ * 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.
352
+ *
353
+ * If two groups have the same priority, the group whose index is smaller will be chosen.
354
+ *
355
+ * For example,
356
+ *
357
+ * ```js
358
+ * import { defineConfig } from 'rolldown';
359
+ *
360
+ * export default defineConfig({
361
+ * advancedChunks: {
362
+ * groups: [
363
+ * {
364
+ * name: 'react',
365
+ * test: /node_modules[\\/]react/,
366
+ * priority: 1,
367
+ * },
368
+ * {
369
+ * name: 'other-libs',
370
+ * test: /node_modules/,
371
+ * priority: 2,
372
+ * },
373
+ * ],
374
+ * });
375
+ * ```
376
+ *
377
+ * This is a clearly __incorrect__ example. Though `react` group is defined before `other-libs`, it has a lower priority, so the modules in `react` group will be captured in `other-libs` group.
378
+ */
379
+ priority?: number;
380
+ /**
381
+ * - Type: `number`
382
+ * - Default: `0`
383
+ *
384
+ * Minimum size in bytes of the desired chunk. If the accumulated size of the captured modules by this group is smaller than this value, it will be ignored. Modules in this group will fall back to the `automatic chunking` if they are not captured by any other group.
385
+ */
386
+ minSize?: number;
387
+ /**
388
+ * - Type: `number`
389
+ * - Default: `1`
390
+ *
391
+ * Controls if a module should be captured based on how many entry chunks reference it.
392
+ */
393
+ minShareCount?: number;
394
+ /**
395
+ * - Type: `number`
396
+ * - Default: `Infinity`
397
+ *
398
+ * If the accumulated size in bytes of the captured modules by this group is larger than this value, this group will be split into multiple groups that each has size close to this value.
399
+ */
400
+ maxSize?: number;
401
+ /**
402
+ * - Type: `number`
403
+ * - Default: `Infinity`
404
+ *
405
+ * Controls a module could only be captured if its size in bytes is smaller or equal than this value.
406
+ */
407
+ maxModuleSize?: number;
408
+ /**
409
+ * - Type: `number`
410
+ * - Default: `0`
411
+ *
412
+ * Controls a module could only be captured if its size in bytes is larger or equal than this value.
413
+ */
414
+ minModuleSize?: number;
415
+ }[];
416
+ };
417
+ /**
418
+ * Control comments in the output.
419
+ *
420
+ * - `none`: no comments
421
+ * - `inline`: preserve comments that contain `@license`, `@preserve` or starts with `//!` `/*!`
422
+ */
423
+ legalComments?: "none" | "inline";
424
+ plugins?: RolldownOutputPluginOption;
425
+ polyfillRequire?: boolean;
426
+ hoistTransitiveImports?: false;
427
+ preserveModules?: boolean;
428
+ virtualDirname?: string;
429
+ preserveModulesRoot?: string;
430
+ topLevelVar?: boolean;
431
+ /**
432
+ * - Type: `boolean`
433
+ * - Default: `false`
434
+ *
435
+ * Whether to minify internal exports.
436
+ */
437
+ minifyInternalExports?: boolean;
438
+ }
439
+ //#endregion
440
+ //#region src/api/build.d.ts
441
+ interface BuildOptions extends InputOptions {
442
+ /**
443
+ * Write the output to the file system
444
+ *
445
+ * @default true
446
+ */
447
+ write?: boolean;
448
+ output?: OutputOptions;
449
+ }
450
+ declare function build(options: BuildOptions): Promise<RolldownOutput>;
451
+ /**
452
+ * Build multiple outputs __sequentially__.
453
+ */
454
+ declare function build(options: BuildOptions[]): Promise<RolldownOutput[]>;
455
+ //#endregion
456
+ //#region src/api/rolldown/rolldown-build.d.ts
457
+ declare class RolldownBuild {
458
+ #private;
459
+ constructor(inputOptions: InputOptions);
460
+ get closed(): boolean;
461
+ generate(outputOptions?: OutputOptions): Promise<RolldownOutput>;
462
+ write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
463
+ close(): Promise<void>;
464
+ [Symbol.asyncDispose](): Promise<void>;
465
+ generateHmrPatch(changedFiles: string[]): Promise<BindingHmrUpdate[]>;
466
+ hmrInvalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrUpdate>;
467
+ get watchFiles(): Promise<string[]>;
468
+ }
469
+ //#endregion
470
+ //#region src/api/rolldown/index.d.ts
471
+ declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>;
472
+ //#endregion
473
+ //#region src/options/watch-options.d.ts
474
+ interface WatchOptions extends InputOptions {
475
+ output?: OutputOptions | OutputOptions[];
476
+ }
477
+ //#endregion
478
+ //#region src/api/watch/watch-emitter.d.ts
479
+ type WatcherEvent = "close" | "event" | "restart" | "change";
480
+ type ChangeEvent$1 = "create" | "update" | "delete";
481
+ type RolldownWatchBuild = BindingBundlerImpl;
482
+ type RolldownWatcherEvent = {
483
+ code: "START";
484
+ } | {
485
+ code: "BUNDLE_START";
486
+ } | {
487
+ code: "BUNDLE_END";
488
+ duration: number;
489
+ output: readonly string[];
490
+ result: RolldownWatchBuild;
491
+ } | {
492
+ code: "END";
493
+ } | {
494
+ code: "ERROR";
495
+ error: Error;
496
+ result: RolldownWatchBuild;
497
+ };
498
+ declare class WatcherEmitter {
499
+ listeners: Map<WatcherEvent, Array<(...parameters: any[]) => MaybePromise<void>>>;
500
+ timer: any;
501
+ constructor();
502
+ on(event: "change", listener: (id: string, change: {
503
+ event: ChangeEvent$1;
504
+ }) => MaybePromise<void>): this;
505
+ on(event: "event", listener: (data: RolldownWatcherEvent) => MaybePromise<void>): this;
506
+ on(event: "restart" | "close", listener: () => MaybePromise<void>): this;
507
+ off(event: WatcherEvent, listener: (...parameters: any[]) => MaybePromise<void>): this;
508
+ clear(event: WatcherEvent): void;
509
+ onEvent(event: BindingWatcherEvent): Promise<void>;
510
+ close(): Promise<void>;
511
+ }
512
+ type RolldownWatcher = WatcherEmitter;
513
+ //#endregion
514
+ //#region src/api/watch/index.d.ts
515
+ declare const watch: (input: WatchOptions | WatchOptions[]) => RolldownWatcher;
516
+ //#endregion
517
+ //#region src/log/log-handler.d.ts
518
+ type LoggingFunction = (log: RollupLog | string | (() => RollupLog | string)) => void;
519
+ type LoggingFunctionWithPosition = (log: RollupLog | string | (() => RollupLog | string), pos?: number | {
520
+ column: number;
521
+ line: number;
522
+ }) => void;
523
+ type WarningHandlerWithDefault = (warning: RollupLog, defaultHandler: LoggingFunction) => void;
524
+ //#endregion
525
+ //#region src/options/normalized-input-options.d.ts
526
+ interface NormalizedInputOptions {
527
+ input: string[] | Record<string, string>;
528
+ cwd: string | undefined;
529
+ platform: InputOptions["platform"];
530
+ shimMissingExports: boolean;
531
+ }
532
+ //#endregion
533
+ //#region src/options/normalized-output-options.d.ts
534
+ type InternalModuleFormat = "es" | "cjs" | "iife" | "umd";
535
+ interface NormalizedOutputOptions {
536
+ name: string | undefined;
537
+ file: string | undefined;
538
+ dir: string | undefined;
539
+ entryFileNames: string | ChunkFileNamesFunction;
540
+ chunkFileNames: string | ChunkFileNamesFunction;
541
+ assetFileNames: string | AssetFileNamesFunction;
542
+ format: InternalModuleFormat;
543
+ exports: NonNullable<OutputOptions["exports"]>;
544
+ sourcemap: boolean | "inline" | "hidden";
545
+ cssEntryFileNames: string | ChunkFileNamesFunction;
546
+ cssChunkFileNames: string | ChunkFileNamesFunction;
547
+ inlineDynamicImports: boolean;
548
+ externalLiveBindings: boolean;
549
+ banner: AddonFunction;
550
+ footer: AddonFunction;
551
+ intro: AddonFunction;
552
+ outro: AddonFunction;
553
+ esModule: boolean | "if-default-prop";
554
+ extend: boolean;
555
+ globals: Record<string, string> | GlobalsFunction;
556
+ hashCharacters: "base64" | "base36" | "hex";
557
+ sourcemapDebugIds: boolean;
558
+ sourcemapIgnoreList: SourcemapIgnoreListOption;
559
+ sourcemapPathTransform: SourcemapPathTransformOption | undefined;
560
+ minify: false | BindingMinifyOptions;
561
+ legalComments: "none" | "inline";
562
+ polyfillRequire: boolean;
563
+ plugins: RolldownPlugin[];
564
+ preserveModules: boolean;
565
+ virtualDirname: string;
566
+ preserveModulesRoot?: string;
567
+ topLevelVar?: boolean;
568
+ minifyInternalExports?: boolean;
569
+ }
570
+ //#endregion
571
+ //#region src/plugin/fs.d.ts
572
+ interface RolldownFsModule {
573
+ appendFile(path: string, data: string | Uint8Array, options?: {
574
+ encoding?: BufferEncoding | null;
575
+ mode?: string | number;
576
+ flag?: string | number;
577
+ }): Promise<void>;
578
+ copyFile(source: string, destination: string, mode?: string | number): Promise<void>;
579
+ mkdir(path: string, options?: {
580
+ recursive?: boolean;
581
+ mode?: string | number;
582
+ }): Promise<void>;
583
+ mkdtemp(prefix: string): Promise<string>;
584
+ readdir(path: string, options?: {
585
+ withFileTypes?: false;
586
+ }): Promise<string[]>;
587
+ readdir(path: string, options?: {
588
+ withFileTypes: true;
589
+ }): Promise<RolldownDirectoryEntry[]>;
590
+ readFile(path: string, options?: {
591
+ encoding?: null;
592
+ flag?: string | number;
593
+ signal?: AbortSignal;
594
+ }): Promise<Uint8Array>;
595
+ readFile(path: string, options?: {
596
+ encoding: BufferEncoding;
597
+ flag?: string | number;
598
+ signal?: AbortSignal;
599
+ }): Promise<string>;
600
+ realpath(path: string): Promise<string>;
601
+ rename(oldPath: string, newPath: string): Promise<void>;
602
+ rmdir(path: string, options?: {
603
+ recursive?: boolean;
604
+ }): Promise<void>;
605
+ stat(path: string): Promise<RolldownFileStats>;
606
+ lstat(path: string): Promise<RolldownFileStats>;
607
+ unlink(path: string): Promise<void>;
608
+ writeFile(path: string, data: string | Uint8Array, options?: {
609
+ encoding?: BufferEncoding | null;
610
+ mode?: string | number;
611
+ flag?: string | number;
612
+ }): Promise<void>;
613
+ }
614
+ type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "base64url" | "latin1" | "binary" | "hex";
615
+ interface RolldownDirectoryEntry {
616
+ isFile(): boolean;
617
+ isDirectory(): boolean;
618
+ isSymbolicLink(): boolean;
619
+ name: string;
620
+ }
621
+ interface RolldownFileStats {
622
+ isFile(): boolean;
623
+ isDirectory(): boolean;
624
+ isSymbolicLink(): boolean;
625
+ size: number;
626
+ mtime: Date;
627
+ ctime: Date;
628
+ atime: Date;
629
+ birthtime: Date;
630
+ }
631
+ //#endregion
632
+ //#region src/plugin/hook-filter.d.ts
633
+ type GeneralHookFilter<Value = StringOrRegExp> = MaybeArray<Value> | {
634
+ include?: MaybeArray<Value>;
635
+ exclude?: MaybeArray<Value>;
636
+ };
637
+ interface FormalModuleTypeFilter {
638
+ include?: ModuleType[];
639
+ }
640
+ type ModuleTypeFilter = ModuleType[] | FormalModuleTypeFilter;
641
+ interface HookFilter {
642
+ /**
643
+ * This filter is used to do a pre-test to determine whether the hook should be called.
644
+ *
645
+ * @example
646
+ * Include all `id`s that contain `node_modules` in the path.
647
+ * ```js
648
+ * { id: '**'+'/node_modules/**' }
649
+ * ```
650
+ * @example
651
+ * Include all `id`s that contain `node_modules` or `src` in the path.
652
+ * ```js
653
+ * { id: ['**'+'/node_modules/**', '**'+'/src/**'] }
654
+ * ```
655
+ * @example
656
+ * Include all `id`s that start with `http`
657
+ * ```js
658
+ * { id: /^http/ }
659
+ * ```
660
+ * @example
661
+ * Exclude all `id`s that contain `node_modules` in the path.
662
+ * ```js
663
+ * { id: { exclude: '**'+'/node_modules/**' } }
664
+ * ```
665
+ * @example
666
+ * Formal pattern to define includes and excludes.
667
+ * ```
668
+ * { id : {
669
+ * include: ['**'+'/foo/**', /bar/],
670
+ * exclude: ['**'+'/baz/**', /qux/]
671
+ * }}
672
+ * ```
673
+ */
674
+ id?: GeneralHookFilter;
675
+ moduleType?: ModuleTypeFilter;
676
+ code?: GeneralHookFilter;
677
+ }
678
+ type TUnionWithTopLevelFilterExpressionArray<T> = T | TopLevelFilterExpression[];
679
+ //#endregion
680
+ //#region src/plugin/minimal-plugin-context.d.ts
681
+ interface PluginContextMeta {
682
+ rollupVersion: string;
683
+ rolldownVersion: string;
684
+ watchMode: boolean;
685
+ }
686
+ interface MinimalPluginContext {
687
+ readonly pluginName: string;
688
+ error: (e: RollupError | string) => never;
689
+ info: LoggingFunction;
690
+ warn: LoggingFunction;
691
+ debug: LoggingFunction;
692
+ meta: PluginContextMeta;
693
+ }
694
+ //#endregion
695
+ //#region src/plugin/parallel-plugin.d.ts
696
+ type ParallelPlugin = {
697
+ /** @internal */
698
+ _parallel: {
699
+ fileUrl: string;
700
+ options: unknown;
701
+ };
702
+ };
703
+ type DefineParallelPluginResult<Options> = (options: Options) => ParallelPlugin;
704
+ declare function defineParallelPlugin<Options>(pluginPath: string): DefineParallelPluginResult<Options>;
705
+ //#endregion
706
+ //#region src/plugin/plugin-context.d.ts
707
+ interface EmittedAsset {
708
+ type: "asset";
709
+ name?: string;
710
+ fileName?: string;
711
+ originalFileName?: string | null;
712
+ source: AssetSource;
713
+ }
714
+ interface EmittedChunk {
715
+ type: "chunk";
716
+ name?: string;
717
+ fileName?: string;
718
+ preserveSignature?: "strict" | "allow-extension" | "exports-only" | false;
719
+ id: string;
720
+ importer?: string;
721
+ }
722
+ type EmittedFile = EmittedAsset | EmittedChunk;
723
+ interface PluginContextResolveOptions {
724
+ isEntry?: boolean;
725
+ skipSelf?: boolean;
726
+ custom?: CustomPluginOptions;
727
+ }
728
+ type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
729
+ interface PluginContext extends MinimalPluginContext {
730
+ fs: RolldownFsModule;
731
+ emitFile(file: EmittedFile): string;
732
+ getFileName(referenceId: string): string;
733
+ getModuleIds(): IterableIterator<string>;
734
+ getModuleInfo: GetModuleInfo;
735
+ addWatchFile(id: string): void;
736
+ load(options: {
737
+ id: string;
738
+ resolveDependencies?: boolean;
739
+ } & Partial<PartialNull<ModuleOptions>>): Promise<ModuleInfo>;
740
+ parse(input: string, options?: ParserOptions | undefined | null): Program;
741
+ resolve(source: string, importer?: string, options?: PluginContextResolveOptions): Promise<ResolvedId | null>;
742
+ }
743
+ //#endregion
744
+ //#region src/plugin/transform-plugin-context.d.ts
745
+ interface TransformPluginContext extends PluginContext {
746
+ debug: LoggingFunctionWithPosition;
747
+ info: LoggingFunctionWithPosition;
748
+ warn: LoggingFunctionWithPosition;
749
+ error(e: RollupError | string, pos?: number | {
750
+ column: number;
751
+ line: number;
752
+ }): never;
753
+ getCombinedSourcemap(): SourceMap;
754
+ }
755
+ //#endregion
756
+ //#region src/types/module-side-effects.d.ts
757
+ interface ModuleSideEffectsRule {
758
+ test?: RegExp;
759
+ external?: boolean;
760
+ sideEffects: boolean;
761
+ }
762
+ type ModuleSideEffectsOption = boolean | ModuleSideEffectsRule[] | ((id: string, isResolved: boolean) => boolean | undefined) | "no-external";
763
+ type TreeshakingOptions = {
764
+ moduleSideEffects?: ModuleSideEffectsOption;
765
+ annotations?: boolean;
766
+ manualPureFunctions?: string[];
767
+ unknownGlobalSideEffects?: boolean;
768
+ commonjs?: boolean;
769
+ } | boolean;
770
+ //#endregion
771
+ //#region src/types/output-bundle.d.ts
772
+ interface OutputBundle {
773
+ [fileName: string]: OutputAsset | OutputChunk;
774
+ }
775
+ //#endregion
776
+ //#region src/types/sourcemap.d.ts
777
+ interface ExistingRawSourceMap {
778
+ file?: string | null;
779
+ mappings: string;
780
+ names?: string[];
781
+ sources?: (string | null)[];
782
+ sourcesContent?: (string | null)[];
783
+ sourceRoot?: string;
784
+ version?: number;
785
+ x_google_ignoreList?: number[];
786
+ }
787
+ type SourceMapInput = ExistingRawSourceMap | string | null;
788
+ //#endregion
789
+ //#region src/index.d.ts
790
+ declare const VERSION: string;
791
+ //#endregion
792
+ //#region src/builtin-plugin/constructors.d.ts
793
+ declare class BuiltinPlugin {
794
+ name: BindingBuiltinPluginName;
795
+ _options?: unknown;
796
+ constructor(name: BindingBuiltinPluginName, _options?: unknown);
797
+ }
798
+ declare function modulePreloadPolyfillPlugin(config?: BindingModulePreloadPolyfillPluginConfig): BuiltinPlugin;
799
+ type DynamicImportVarsPluginConfig = Omit<BindingDynamicImportVarsPluginConfig, "include" | "exclude"> & {
800
+ include?: StringOrRegExp | StringOrRegExp[];
801
+ exclude?: StringOrRegExp | StringOrRegExp[];
802
+ };
803
+ declare function dynamicImportVarsPlugin(config?: DynamicImportVarsPluginConfig): BuiltinPlugin;
804
+ declare function importGlobPlugin(config?: BindingImportGlobPluginConfig): BuiltinPlugin;
805
+ declare function reporterPlugin(config?: BindingReporterPluginConfig): BuiltinPlugin;
806
+ declare function manifestPlugin(config?: BindingManifestPluginConfig): BuiltinPlugin;
807
+ declare function wasmHelperPlugin(config?: BindingWasmHelperPluginConfig): BuiltinPlugin;
808
+ declare function wasmFallbackPlugin(): BuiltinPlugin;
809
+ declare function loadFallbackPlugin(): BuiltinPlugin;
810
+ declare function jsonPlugin(config?: BindingJsonPluginConfig): BuiltinPlugin;
811
+ declare function buildImportAnalysisPlugin(config: BindingBuildImportAnalysisPluginConfig): BuiltinPlugin;
812
+ declare function viteResolvePlugin(config: BindingViteResolvePluginConfig): BuiltinPlugin;
813
+ declare function isolatedDeclarationPlugin(config?: BindingIsolatedDeclarationPluginConfig): BuiltinPlugin;
814
+ declare function assetPlugin(config?: BindingAssetPluginConfig): BuiltinPlugin;
815
+ declare function webWorkerPostPlugin(): BuiltinPlugin;
816
+ //#endregion
817
+ //#region src/constants/plugin.d.ts
818
+ declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"];
819
+ declare const ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES: readonly ["augmentChunkHash", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "generateBundle"];
820
+ declare const ENUMERATED_PLUGIN_HOOK_NAMES: [...typeof ENUMERATED_INPUT_PLUGIN_HOOK_NAMES, ...typeof ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES, "footer", "banner", "intro", "outro"];
821
+ /**
822
+ * Names of all defined hooks. It's like
823
+ * ```ts
824
+ * type DefinedHookNames = {
825
+ * options: 'options',
826
+ * buildStart: 'buildStart',
827
+ * ...
828
+ * }
829
+ * ```
830
+ */
831
+ type DefinedHookNames = { readonly [K in typeof ENUMERATED_PLUGIN_HOOK_NAMES[number]]: K };
832
+ /**
833
+ * Names of all defined hooks. It's like
834
+ * ```js
835
+ * const DEFINED_HOOK_NAMES ={
836
+ * options: 'options',
837
+ * buildStart: 'buildStart',
838
+ * ...
839
+ * }
840
+ * ```
841
+ */
842
+ declare const DEFINED_HOOK_NAMES: DefinedHookNames;
843
+ //#endregion
844
+ //#region src/plugin/with-filter.d.ts
845
+ type OverrideFilterObject = {
846
+ transform?: HookFilterExtension<"transform">["filter"];
847
+ resolveId?: HookFilterExtension<"resolveId">["filter"];
848
+ load?: HookFilterExtension<"load">["filter"];
849
+ pluginNamePattern?: StringOrRegExp[];
850
+ };
851
+ declare function withFilter<A, T extends RolldownPluginOption<A>>(pluginOption: T, filterObject: OverrideFilterObject | OverrideFilterObject[]): T;
852
+ //#endregion
853
+ //#region src/plugin/index.d.ts
854
+ type ModuleSideEffects = boolean | "no-treeshake" | null;
855
+ type ModuleType = "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | (string & {});
856
+ type ImportKind = BindingHookResolveIdExtraArgs["kind"];
857
+ interface CustomPluginOptions {
858
+ [plugin: string]: any;
859
+ }
860
+ interface ModuleOptions {
861
+ moduleSideEffects: ModuleSideEffects;
862
+ meta: CustomPluginOptions;
863
+ invalidate?: boolean;
864
+ }
865
+ interface ResolvedId extends ModuleOptions {
866
+ external: boolean | "absolute";
867
+ id: string;
868
+ }
869
+ interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
870
+ external?: boolean | "absolute" | "relative";
871
+ id: string;
872
+ }
873
+ interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
874
+ code: string;
875
+ map?: SourceMapInput;
876
+ moduleType?: ModuleType;
877
+ }
878
+ interface ResolveIdExtraOptions {
879
+ custom?: CustomPluginOptions;
880
+ isEntry: boolean;
881
+ kind: BindingHookResolveIdExtraArgs["kind"];
882
+ }
883
+ type ResolveIdResult = string | NullValue | false | PartialResolvedId;
884
+ type LoadResult = NullValue | string | SourceDescription;
885
+ type TransformResult = NullValue | string | Partial<SourceDescription>;
886
+ type RenderedChunkMeta = {
887
+ chunks: Record<string, RenderedChunk>;
888
+ };
889
+ interface FunctionPluginHooks {
890
+ [DEFINED_HOOK_NAMES.onLog]: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => NullValue | boolean;
891
+ [DEFINED_HOOK_NAMES.options]: (this: MinimalPluginContext, options: InputOptions) => NullValue | InputOptions;
892
+ [DEFINED_HOOK_NAMES.outputOptions]: (this: MinimalPluginContext, options: OutputOptions) => NullValue | OutputOptions;
893
+ [DEFINED_HOOK_NAMES.buildStart]: (this: PluginContext, options: NormalizedInputOptions) => void;
894
+ [DEFINED_HOOK_NAMES.resolveId]: (this: PluginContext, source: string, importer: string | undefined, extraOptions: ResolveIdExtraOptions) => ResolveIdResult;
895
+ /**
896
+ * @deprecated
897
+ * This hook is only for rollup plugin compatibility. Please use `resolveId` instead.
898
+ */
899
+ [DEFINED_HOOK_NAMES.resolveDynamicImport]: (this: PluginContext, source: string, importer: string | undefined) => ResolveIdResult;
900
+ [DEFINED_HOOK_NAMES.load]: (this: PluginContext, id: string) => MaybePromise<LoadResult>;
901
+ [DEFINED_HOOK_NAMES.transform]: (this: TransformPluginContext, code: string, id: string, meta: BindingTransformHookExtraArgs & {
902
+ moduleType: ModuleType;
903
+ }) => TransformResult;
904
+ [DEFINED_HOOK_NAMES.moduleParsed]: (this: PluginContext, moduleInfo: ModuleInfo) => void;
905
+ [DEFINED_HOOK_NAMES.buildEnd]: (this: PluginContext, err?: Error) => void;
906
+ [DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
907
+ [DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | {
908
+ code: string;
909
+ map?: SourceMapInput;
910
+ };
911
+ [DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RenderedChunk) => string | void;
912
+ [DEFINED_HOOK_NAMES.renderError]: (this: PluginContext, error: Error) => void;
913
+ [DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
914
+ [DEFINED_HOOK_NAMES.writeBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle) => void;
915
+ [DEFINED_HOOK_NAMES.closeBundle]: (this: PluginContext) => void;
916
+ [DEFINED_HOOK_NAMES.watchChange]: (this: PluginContext, id: string, event: {
917
+ event: ChangeEvent;
918
+ }) => void;
919
+ [DEFINED_HOOK_NAMES.closeWatcher]: (this: PluginContext) => void;
920
+ }
921
+ type ChangeEvent = "create" | "update" | "delete";
922
+ type PluginOrder = "pre" | "post" | null;
923
+ type ObjectHookMeta = {
924
+ order?: PluginOrder;
925
+ };
926
+ type ObjectHook<T, O = {}> = T | ({
927
+ handler: T;
928
+ } & ObjectHookMeta & O);
929
+ type SyncPluginHooks = DefinedHookNames["augmentChunkHash" | "onLog" | "outputOptions"];
930
+ type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
931
+ type FirstPluginHooks = DefinedHookNames["load" | "resolveDynamicImport" | "resolveId"];
932
+ type SequentialPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "onLog" | "options" | "outputOptions" | "renderChunk" | "transform"];
933
+ type AddonHooks = DefinedHookNames["banner" | "footer" | "intro" | "outro"];
934
+ type OutputPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "outputOptions" | "renderChunk" | "renderError" | "renderStart" | "writeBundle"];
935
+ type ParallelPluginHooks = Exclude<keyof FunctionPluginHooks | AddonHooks, FirstPluginHooks | SequentialPluginHooks>;
936
+ type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends "transform" ? {
937
+ filter?: TUnionWithTopLevelFilterExpressionArray<HookFilter>;
938
+ } : K extends "load" ? {
939
+ filter?: TUnionWithTopLevelFilterExpressionArray<Pick<HookFilter, "id">>;
940
+ } : K extends "resolveId" ? {
941
+ filter?: TUnionWithTopLevelFilterExpressionArray<{
942
+ id?: GeneralHookFilter<RegExp>;
943
+ }>;
944
+ } : K extends "renderChunk" ? {
945
+ filter?: TUnionWithTopLevelFilterExpressionArray<Pick<HookFilter, "code">>;
946
+ } : {};
947
+ type PluginHooks = { [K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], HookFilterExtension<K> & (K extends ParallelPluginHooks ? {
948
+ /**
949
+ * @deprecated
950
+ * this is only for rollup Plugin type compatibility.
951
+ * hooks always work as `sequential: true`.
952
+ */
953
+ sequential?: boolean;
954
+ } : {})> };
955
+ type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>;
956
+ type AddonHook = string | AddonHookFunction;
957
+ interface OutputPlugin extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>, Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
958
+ name: string;
959
+ }
960
+ interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
961
+ api?: A;
962
+ }
963
+ type RolldownPlugin<A = any> = Plugin<A> | BuiltinPlugin | ParallelPlugin;
964
+ type RolldownPluginOption<A = any> = MaybePromise<NullValue<RolldownPlugin<A>> | {
965
+ name: string;
966
+ } | false | RolldownPluginOption[]>;
967
+ type RolldownOutputPlugin = OutputPlugin | BuiltinPlugin;
968
+ type RolldownOutputPluginOption = MaybePromise<NullValue<RolldownOutputPlugin> | {
969
+ name: string;
970
+ } | false | RolldownOutputPluginOption[]>;
971
+ //#endregion
972
+ //#region src/options/generated/checks-options.d.ts
973
+ interface ChecksOptions {
974
+ /**
975
+ * Whether to emit warning when detecting circular dependency
976
+ * @default false
977
+ */
978
+ circularDependency?: boolean;
979
+ /**
980
+ * Whether to emit warning when detecting eval
981
+ * @default true
982
+ */
983
+ eval?: boolean;
984
+ /**
985
+ * Whether to emit warning when detecting missing global name
986
+ * @default true
987
+ */
988
+ missingGlobalName?: boolean;
989
+ /**
990
+ * Whether to emit warning when detecting missing name option for iife export
991
+ * @default true
992
+ */
993
+ missingNameOptionForIifeExport?: boolean;
994
+ /**
995
+ * Whether to emit warning when detecting mixed export
996
+ * @default true
997
+ */
998
+ mixedExport?: boolean;
999
+ /**
1000
+ * Whether to emit warning when detecting unresolved entry
1001
+ * @default true
1002
+ */
1003
+ unresolvedEntry?: boolean;
1004
+ /**
1005
+ * Whether to emit warning when detecting unresolved import
1006
+ * @default true
1007
+ */
1008
+ unresolvedImport?: boolean;
1009
+ /**
1010
+ * Whether to emit warning when detecting filename conflict
1011
+ * @default true
1012
+ */
1013
+ filenameConflict?: boolean;
1014
+ /**
1015
+ * Whether to emit warning when detecting common js variable in esm
1016
+ * @default true
1017
+ */
1018
+ commonJsVariableInEsm?: boolean;
1019
+ /**
1020
+ * Whether to emit warning when detecting import is undefined
1021
+ * @default true
1022
+ */
1023
+ importIsUndefined?: boolean;
1024
+ /**
1025
+ * Whether to emit warning when detecting empty import meta
1026
+ * @default true
1027
+ */
1028
+ emptyImportMeta?: boolean;
1029
+ /**
1030
+ * Whether to emit warning when detecting configuration field conflict
1031
+ * @default true
1032
+ */
1033
+ configurationFieldConflict?: boolean;
1034
+ }
1035
+ //#endregion
1036
+ //#region src/options/input-options.d.ts
1037
+ type InputOption = string | string[] | Record<string, string>;
1038
+ type OxcTransformOption = Omit<TransformOptions, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject">;
1039
+ type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
1040
+ type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset">;
1041
+ interface WatcherOptions {
1042
+ skipWrite?: boolean;
1043
+ buildDelay?: number;
1044
+ notify?: {
1045
+ pollInterval?: number;
1046
+ compareContents?: boolean;
1047
+ };
1048
+ include?: StringOrRegExp | StringOrRegExp[];
1049
+ exclude?: StringOrRegExp | StringOrRegExp[];
1050
+ onInvalidate?: (id: string) => void;
1051
+ }
1052
+ type MakeAbsoluteExternalsRelative = boolean | "ifRelativeSource";
1053
+ type HmrOptions = boolean | {
1054
+ host?: string;
1055
+ port?: number;
1056
+ implement?: string;
1057
+ };
1058
+ type OptimizationOptions = {
1059
+ inlineConst?: boolean;
1060
+ };
1061
+ type AttachDebugOptions = "none" | "simple" | "full";
1062
+ type ChunkModulesOrder = "exec-order" | "module-id";
1063
+ interface RollupJsxOptions {
1064
+ mode?: "classic" | "automatic" | "preserve";
1065
+ factory?: string;
1066
+ fragment?: string;
1067
+ importSource?: string;
1068
+ jsxImportSource?: string;
1069
+ }
1070
+ interface InputOptions {
1071
+ input?: InputOption;
1072
+ plugins?: RolldownPluginOption;
1073
+ external?: ExternalOption;
1074
+ resolve?: {
1075
+ /**
1076
+ * > [!WARNING]
1077
+ * > `resolve.alias` will not call `resolveId` hooks of other plugin.
1078
+ * > If you want to call `resolveId` hooks of other plugin, use `aliasPlugin` from `rolldown/experimental` instead.
1079
+ * > You could find more discussion in [this issue](https://github.com/rolldown/rolldown/issues/3615)
1080
+ */
1081
+ alias?: Record<string, string[] | string>;
1082
+ aliasFields?: string[][];
1083
+ conditionNames?: string[];
1084
+ /**
1085
+ * Map of extensions to alternative extensions.
1086
+ *
1087
+ * With writing `import './foo.js'` in a file, you want to resolve it to `foo.ts` instead of `foo.js`.
1088
+ * You can achieve this by setting: `extensionAlias: { '.js': ['.ts', '.js'] }`.
1089
+ */
1090
+ extensionAlias?: Record<string, string[]>;
1091
+ exportsFields?: string[][];
1092
+ extensions?: string[];
1093
+ mainFields?: string[];
1094
+ mainFiles?: string[];
1095
+ modules?: string[];
1096
+ symlinks?: boolean;
1097
+ tsconfigFilename?: string;
1098
+ };
1099
+ cwd?: string;
1100
+ /**
1101
+ * Expected platform where the code run.
1102
+ *
1103
+ * @default
1104
+ * - 'node' if the format is 'cjs'
1105
+ * - 'browser' for other formats
1106
+ */
1107
+ platform?: "node" | "browser" | "neutral";
1108
+ shimMissingExports?: boolean;
1109
+ treeshake?: boolean | TreeshakingOptions;
1110
+ logLevel?: LogLevelOption;
1111
+ onLog?: (level: LogLevel, log: RollupLog, defaultHandler: LogOrStringHandler) => void;
1112
+ onwarn?: (warning: RollupLog, defaultHandler: (warning: RollupLogWithString | (() => RollupLogWithString)) => void) => void;
1113
+ moduleTypes?: ModuleTypes;
1114
+ experimental?: {
1115
+ strictExecutionOrder?: boolean;
1116
+ disableLiveBindings?: boolean;
1117
+ viteMode?: boolean;
1118
+ resolveNewUrlToAsset?: boolean;
1119
+ hmr?: HmrOptions;
1120
+ /**
1121
+ * Control which order should use when rendering modules in chunk
1122
+ *
1123
+ * - Type: `'exec-order' | 'module-id'
1124
+ * - Default: `'exec-order'`
1125
+ *
1126
+ * - `exec-order`: Almost equivalent to the topological order of the module graph, but specially handling when module graph has cycle.
1127
+ * - `module-id`: This is more friendly for gzip compression, especially for some javascript static asset lib (e.g. icon library)
1128
+ * > [!NOTE]
1129
+ * > Try to sort the modules by their module id if possible(Since rolldown scope hoist all modules in the chunk, we only try to sort those modules by module id if we could ensure runtime behavior is correct after sorting).
1130
+ */
1131
+ chunkModulesOrder?: ChunkModulesOrder;
1132
+ /**
1133
+ * Attach debug information to the output bundle.
1134
+ *
1135
+ * - Type: `'none' | 'simple' | 'full'`
1136
+ * - Default: `'simple'`
1137
+ *
1138
+ * - `none`: No debug information is attached.
1139
+ * - `simple`: Attach comments indicating which files the bundled code comes from. These comments could be removed by the minifier.
1140
+ * - `full`: Attach detailed debug information to the output bundle. These comments are using legal comment syntax, so they won't be removed by the minifier.
1141
+ *
1142
+ * > [!WARNING]
1143
+ * > You shouldn't use `full` in the production build.
1144
+ */
1145
+ attachDebugInfo?: AttachDebugOptions;
1146
+ /**
1147
+ * Enables automatic generation of a chunk import map asset during build.
1148
+ *
1149
+ * This map only includes chunks with hashed filenames, where keys are derived from the facade module
1150
+ * name or primary chunk name. It produces stable and unique hash-based filenames, effectively preventing
1151
+ * cascading cache invalidation caused by content hashes and maximizing browser cache reuse.
1152
+ *
1153
+ * The output defaults to `importmap.json` unless overridden via `fileName`. A base URL prefix
1154
+ * (default `"/"`) can be applied to all paths. The resulting JSON is a valid import map and can be
1155
+ * directly injected into HTML via `<script type="importmap">`.
1156
+ *
1157
+ * Example configuration snippet:
1158
+ *
1159
+ * ```js
1160
+ * {
1161
+ * experimental: {
1162
+ * chunkImportMap: {
1163
+ * baseUrl: '/',
1164
+ * fileName: 'importmap.json'
1165
+ * }
1166
+ * },
1167
+ * plugins: [
1168
+ * {
1169
+ * name: 'inject-import-map',
1170
+ * generateBundle(_, bundle) {
1171
+ * const chunkImportMap = bundle['importmap.json'];
1172
+ * if (chunkImportMap?.type === 'asset') {
1173
+ * const htmlPath = path.resolve('index.html');
1174
+ * let html = fs.readFileSync(htmlPath, 'utf-8');
1175
+ *
1176
+ * html = html.replace(
1177
+ * /<script\s+type="importmap"[^>]*>[\s\S]*?<\/script>/i,
1178
+ * `<script type="importmap">${chunkImportMap.source}<\/script>`
1179
+ * );
1180
+ *
1181
+ * fs.writeFileSync(htmlPath, html);
1182
+ * delete bundle['importmap.json'];
1183
+ * }
1184
+ * }
1185
+ * }
1186
+ * ]
1187
+ * }
1188
+ * ```
1189
+ *
1190
+ * > [!NOTE]
1191
+ * > If you want to learn more, you can check out the example here: [examples/chunk-import-map](https://github.com/rolldown/rolldown/tree/main/examples/chunk-import-map)
1192
+ */
1193
+ chunkImportMap?: boolean | {
1194
+ baseUrl?: string;
1195
+ fileName?: string;
1196
+ };
1197
+ onDemandWrapping?: boolean;
1198
+ /**
1199
+ * Required to be used with `watch` mode.
1200
+ */
1201
+ incrementalBuild?: boolean;
1202
+ transformHiresSourcemap?: boolean | "boundary";
1203
+ };
1204
+ /**
1205
+ * Replace global variables or [property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) with the provided values.
1206
+ *
1207
+ * # Examples
1208
+ *
1209
+ * - Replace the global variable `IS_PROD` with `true`
1210
+ *
1211
+ * ```js rolldown.config.js
1212
+ * export default defineConfig({ define: { IS_PROD: 'true' // or JSON.stringify(true) } })
1213
+ * ```
1214
+ *
1215
+ * Result:
1216
+ *
1217
+ * ```js
1218
+ * // Input
1219
+ * if (IS_PROD) {
1220
+ * console.log('Production mode')
1221
+ * }
1222
+ *
1223
+ * // After bundling
1224
+ * if (true) {
1225
+ * console.log('Production mode')
1226
+ * }
1227
+ * ```
1228
+ *
1229
+ * - Replace the property accessor `process.env.NODE_ENV` with `'production'`
1230
+ *
1231
+ * ```js rolldown.config.js
1232
+ * export default defineConfig({ define: { 'process.env.NODE_ENV': "'production'" } })
1233
+ * ```
1234
+ *
1235
+ * Result:
1236
+ *
1237
+ * ```js
1238
+ * // Input
1239
+ * if (process.env.NODE_ENV === 'production') {
1240
+ * console.log('Production mode')
1241
+ * }
1242
+ *
1243
+ * // After bundling
1244
+ * if ('production' === 'production') {
1245
+ * console.log('Production mode')
1246
+ * }
1247
+ *
1248
+ * ```
1249
+ */
1250
+ define?: Record<string, string>;
1251
+ /**
1252
+ * Inject import statements on demand.
1253
+ *
1254
+ * ## Supported patterns
1255
+ * ```js
1256
+ * {
1257
+ * // import { Promise } from 'es6-promise'
1258
+ * Promise: ['es6-promise', 'Promise'],
1259
+ *
1260
+ * // import { Promise as P } from 'es6-promise'
1261
+ * P: ['es6-promise', 'Promise'],
1262
+ *
1263
+ * // import $ from 'jquery'
1264
+ * $: 'jquery',
1265
+ *
1266
+ * // import * as fs from 'node:fs'
1267
+ * fs: ['node:fs', '*'],
1268
+ *
1269
+ * // Inject shims for property access pattern
1270
+ * 'Object.assign': path.resolve( 'src/helpers/object-assign.js' ),
1271
+ * }
1272
+ * ```
1273
+ */
1274
+ inject?: Record<string, string | [string, string]>;
1275
+ profilerNames?: boolean;
1276
+ /**
1277
+ * - `false` disables the JSX parser, resulting in a syntax error if JSX syntax is used.
1278
+ * - `"preserve"` disables the JSX transformer, preserving the original JSX syntax in the output.
1279
+ * - `"react"` enables the `classic` JSX transformer.
1280
+ * - `"react-jsx"` enables the `automatic` JSX transformer.
1281
+ *
1282
+ * @default runtime = "automatic"
1283
+ */
1284
+ jsx?: false | "react" | "react-jsx" | "preserve" | RollupJsxOptions;
1285
+ /**
1286
+ * Configure how the code is transformed. This process happens after the `transform` hook.
1287
+ *
1288
+ * To transpile [legacy decorators](https://github.com/tc39/proposal-decorators/tree/4ac0f4cd31bd0f2e8170cb4c5136e51671e46c8d), you could use
1289
+ *
1290
+ * ```js
1291
+ * export default defineConfig({
1292
+ * transform: {
1293
+ * decorator: {
1294
+ * legacy: true,
1295
+ * },
1296
+ * },
1297
+ * })
1298
+ * ```
1299
+ *
1300
+ * For latest decorators proposal, rolldown is able to bundle them but doesn't support transpiling them yet.
1301
+ */
1302
+ transform?: OxcTransformOption;
1303
+ watch?: WatcherOptions | false;
1304
+ dropLabels?: string[];
1305
+ keepNames?: boolean;
1306
+ checks?: ChecksOptions;
1307
+ makeAbsoluteExternalsRelative?: MakeAbsoluteExternalsRelative;
1308
+ debug?: {
1309
+ sessionId?: string;
1310
+ };
1311
+ preserveEntrySignatures?: false | "strict" | "allow-extension" | "exports-only";
1312
+ optimization?: OptimizationOptions;
1313
+ }
1314
+ //#endregion
1315
+ //#region src/types/rolldown-options.d.ts
1316
+ interface RolldownOptions extends InputOptions {
1317
+ output?: OutputOptions | OutputOptions[];
1318
+ }
1319
+ //#endregion
1320
+ //#region src/types/config-export.d.ts
1321
+ /**
1322
+ * Type for `default export` of `rolldown.config.js` file.
1323
+ */
1324
+ type ConfigExport = RolldownOptions | RolldownOptions[];
1325
+ //#endregion
1326
+ //#region src/utils/define-config.d.ts
1327
+ declare function defineConfig(config: RolldownOptions): RolldownOptions;
1328
+ declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
1329
+ declare function defineConfig(config: ConfigExport): ConfigExport;
1330
+ //#endregion
1331
+ export { type AddonFunction, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, BuiltinPlugin, type ChunkFileNamesFunction, type ChunkingContext, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedFile, type ExistingRawSourceMap, type ExternalOption, type FunctionPluginHooks, type GeneralHookFilter, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, MaybePromise, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PreRenderedAsset, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownFileStats, type RolldownFsModule, type RolldownOptions, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RollupError, type RollupLog, type RollupLogWithString, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherOptions, assetPlugin, build, buildImportAnalysisPlugin, defineConfig, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, reporterPlugin, rolldown, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch, webWorkerPostPlugin, withFilter };