@rollipop/rolldown 1.0.0-rc.1 → 1.0.0-rc.10

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 (50) hide show
  1. package/bin/cli.mjs +0 -1
  2. package/dist/cli.mjs +705 -1102
  3. package/dist/config.d.mts +9 -5
  4. package/dist/config.mjs +4 -14
  5. package/dist/experimental-index.d.mts +189 -54
  6. package/dist/experimental-index.mjs +106 -22
  7. package/dist/experimental-runtime-types.d.ts +0 -5
  8. package/dist/filter-index.d.mts +1 -2
  9. package/dist/filter-index.mjs +25 -8
  10. package/dist/get-log-filter.d.mts +3 -7
  11. package/dist/get-log-filter.mjs +23 -3
  12. package/dist/index.d.mts +4 -4
  13. package/dist/index.mjs +6 -13
  14. package/dist/parallel-plugin-worker.mjs +4 -8
  15. package/dist/parallel-plugin.d.mts +3 -4
  16. package/dist/parallel-plugin.mjs +1 -2
  17. package/dist/parse-ast-index.d.mts +26 -2
  18. package/dist/parse-ast-index.mjs +60 -4
  19. package/dist/plugins-index.d.mts +8 -5
  20. package/dist/plugins-index.mjs +8 -8
  21. package/dist/shared/{binding-tNJoEqAa.mjs → binding-D_jQsHun.mjs} +41 -43
  22. package/dist/shared/binding-hSQGgsUz.d.mts +1877 -0
  23. package/dist/shared/{bindingify-input-options-CfhrNd_y.mjs → bindingify-input-options-DfXGy4QO.mjs} +127 -167
  24. package/dist/shared/{constructors-414MPkgB.mjs → constructors-B-HbV10G.mjs} +14 -7
  25. package/dist/shared/{constructors--k1uxZrh.d.mts → constructors-DMl58KN5.d.mts} +13 -4
  26. package/dist/shared/define-config-BSxBeCq6.d.mts +3810 -0
  27. package/dist/shared/{define-config-BVG4QvnP.mjs → define-config-DJOr6Iwt.mjs} +1 -2
  28. package/dist/shared/error-D5tMcn3l.mjs +85 -0
  29. package/dist/shared/get-log-filter-semyr3Lj.d.mts +35 -0
  30. package/dist/shared/{load-config-Qtd9pHJ5.mjs → load-config-CNjYgiQv.mjs} +11 -5
  31. package/dist/shared/{logging-wIy4zY9I.d.mts → logging-C6h4g8dA.d.mts} +6 -6
  32. package/dist/shared/{logs-NH298mHo.mjs → logs-D80CXhvg.mjs} +6 -9
  33. package/dist/shared/{misc-CCZIsXVO.mjs → misc-DJYbNKZX.mjs} +1 -2
  34. package/dist/shared/{normalize-string-or-regex-DeB7vQ75.mjs → normalize-string-or-regex-B8PEhdn1.mjs} +22 -17
  35. package/dist/shared/parse-iQx2ihYn.mjs +74 -0
  36. package/dist/shared/{prompt-tlfjalEt.mjs → prompt-BYQIwEjg.mjs} +4 -6
  37. package/dist/shared/resolve-tsconfig-CxoM-bno.mjs +113 -0
  38. package/dist/shared/{rolldown-BMzJcmQ7.mjs → rolldown-C0o3hS3w.mjs} +2 -4
  39. package/dist/shared/rolldown-build-80GULIOI.mjs +3326 -0
  40. package/dist/shared/transform-DY2pi3Qm.d.mts +149 -0
  41. package/dist/shared/{watch-HmN4U4B9.mjs → watch-C2am0Ahc.mjs} +73 -78
  42. package/dist/utils-index.d.mts +376 -0
  43. package/dist/utils-index.mjs +2414 -0
  44. package/package.json +23 -21
  45. package/dist/cli-setup.d.mts +0 -1
  46. package/dist/cli-setup.mjs +0 -17
  47. package/dist/shared/binding-B92Lq__Q.d.mts +0 -1687
  48. package/dist/shared/define-config-D8xP5iyL.d.mts +0 -3463
  49. package/dist/shared/parse-ast-index-BcP4Ts_P.mjs +0 -99
  50. package/dist/shared/rolldown-build-DWeKtJOy.mjs +0 -2371
package/dist/config.d.mts CHANGED
@@ -1,10 +1,14 @@
1
- import "./shared/binding-B92Lq__Q.mjs";
2
- import { r as defineConfig, t as ConfigExport } from "./shared/define-config-D8xP5iyL.mjs";
1
+ import { F as VERSION, r as defineConfig, t as ConfigExport } from "./shared/define-config-BSxBeCq6.mjs";
3
2
 
4
3
  //#region src/utils/load-config.d.ts
4
+ /**
5
+ * Load config from a file in a way that Rolldown does.
6
+ *
7
+ * @param configPath The path to the config file. If empty, it will look for `rolldown.config` with supported extensions in the current working directory.
8
+ * @returns The loaded config export
9
+ *
10
+ * @category Config
11
+ */
5
12
  declare function loadConfig(configPath: string): Promise<ConfigExport>;
6
13
  //#endregion
7
- //#region src/config.d.ts
8
- declare const VERSION: string;
9
- //#endregion
10
14
  export { VERSION, defineConfig, loadConfig };
package/dist/config.mjs CHANGED
@@ -1,14 +1,4 @@
1
- import "./shared/binding-tNJoEqAa.mjs";
2
- import "./shared/normalize-string-or-regex-DeB7vQ75.mjs";
3
- import { w as version } from "./shared/bindingify-input-options-CfhrNd_y.mjs";
4
- import "./shared/rolldown-build-DWeKtJOy.mjs";
5
- import "./shared/parse-ast-index-BcP4Ts_P.mjs";
6
- import "./shared/rolldown-BMzJcmQ7.mjs";
7
- import { t as defineConfig } from "./shared/define-config-BVG4QvnP.mjs";
8
- import { t as loadConfig } from "./shared/load-config-Qtd9pHJ5.mjs";
9
-
10
- //#region src/config.ts
11
- const VERSION = version;
12
-
13
- //#endregion
14
- export { VERSION, defineConfig, loadConfig };
1
+ import { x as VERSION } from "./shared/bindingify-input-options-DfXGy4QO.mjs";
2
+ import { t as defineConfig } from "./shared/define-config-DJOr6Iwt.mjs";
3
+ import { t as loadConfig } from "./shared/load-config-CNjYgiQv.mjs";
4
+ export { VERSION, defineConfig, loadConfig };
@@ -1,6 +1,7 @@
1
- import { A as MinifyResult, B as isolatedDeclaration, D as IsolatedDeclarationsResult, E as IsolatedDeclarationsOptions, F as ResolveResult, G as transform, H as minify, I as ResolverFactory, K as transformSync, L as TransformOptions, M as ParseResult, N as ParserOptions, R as TransformResult, S as BindingViteTransformPluginConfig, U as minifySync, V as isolatedDeclarationSync, W as moduleRunnerTransform, _ as BindingViteManifestPluginConfig, j as NapiResolveOptions, k as MinifyOptions, l as BindingRebuildStrategy, n as BindingBundleState, r as BindingClientHmrUpdate, z as createTokioRuntime } from "./shared/binding-B92Lq__Q.mjs";
2
- import { M as BuiltinPlugin, Mt as OutputOptions, Ut as freeExternalMemory, Vt as RolldownOutput, c as InputOptions, it as NormalizedOutputOptions, q as defineParallelPlugin } from "./shared/define-config-D8xP5iyL.mjs";
3
- import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWasmHelperPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./shared/constructors--k1uxZrh.mjs";
1
+ import { A as BindingViteTransformPluginConfig, H as ResolveResult, J as isolatedDeclarationSync, N as IsolatedDeclarationsOptions, P as IsolatedDeclarationsResult, R as NapiResolveOptions, T as BindingViteManifestPluginConfig, U as ResolverFactory, Y as moduleRunnerTransform, f as BindingRebuildStrategy, g as BindingRollipopWorkletsPluginConfig, h as BindingRollipopReactRefreshWrapperPluginConfig, i as BindingClientHmrUpdate, n as BindingBundleAnalyzerPluginConfig, q as isolatedDeclaration, r as BindingBundleState, v as BindingTsconfigCompilerOptions, y as BindingTsconfigRawOptions } from "./shared/binding-hSQGgsUz.mjs";
2
+ import { Jt as freeExternalMemory, Kt as RolldownOutput, Lt as OutputOptions, N as BuiltinPlugin, X as defineParallelPlugin, c as InputOptions, st as NormalizedOutputOptions } from "./shared/define-config-BSxBeCq6.mjs";
3
+ import { a as MinifyOptions$1, c as minifySync$1, d as parse$1, f as parseSync$1, i as transformSync$1, l as ParseResult$1, m as resolveTsconfig, n as TransformResult$1, o as MinifyResult$1, p as TsconfigCache$1, r as transform$1, s as minify$1, t as TransformOptions$1, u as ParserOptions$1 } from "./shared/transform-DY2pi3Qm.mjs";
4
+ import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWasmFallbackPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-DMl58KN5.mjs";
4
5
 
5
6
  //#region src/api/dev/dev-options.d.ts
6
7
  type DevOnHmrUpdates = (result: Error | {
@@ -10,54 +11,54 @@ type DevOnHmrUpdates = (result: Error | {
10
11
  type DevOnOutput = (result: Error | RolldownOutput) => void | Promise<void>;
11
12
  interface DevWatchOptions {
12
13
  /**
13
- * If `true`, files are not written to disk.
14
- * @default false
15
- */
14
+ * If `true`, files are not written to disk.
15
+ * @default false
16
+ */
16
17
  skipWrite?: boolean;
17
18
  /**
18
- * If `true`, use polling instead of native file system events for watching.
19
- * @default false
20
- */
19
+ * If `true`, use polling instead of native file system events for watching.
20
+ * @default false
21
+ */
21
22
  usePolling?: boolean;
22
23
  /**
23
- * Poll interval in milliseconds (only used when usePolling is true).
24
- * @default 100
25
- */
24
+ * Poll interval in milliseconds (only used when usePolling is true).
25
+ * @default 100
26
+ */
26
27
  pollInterval?: number;
27
28
  /**
28
- * If `true`, use debounced watcher. If `false`, use non-debounced watcher for immediate responses.
29
- * @default true
30
- */
29
+ * If `true`, use debounced watcher. If `false`, use non-debounced watcher for immediate responses.
30
+ * @default true
31
+ */
31
32
  useDebounce?: boolean;
32
33
  /**
33
- * Debounce duration in milliseconds (only used when useDebounce is true).
34
- * @default 10
35
- */
34
+ * Debounce duration in milliseconds (only used when useDebounce is true).
35
+ * @default 10
36
+ */
36
37
  debounceDuration?: number;
37
38
  /**
38
- * Whether to compare file contents for poll-based watchers (only used when usePolling is true).
39
- * When enabled, poll watchers will check file contents to determine if they actually changed.
40
- * @default false
41
- */
39
+ * Whether to compare file contents for poll-based watchers (only used when usePolling is true).
40
+ * When enabled, poll watchers will check file contents to determine if they actually changed.
41
+ * @default false
42
+ */
42
43
  compareContentsForPolling?: boolean;
43
44
  /**
44
- * Tick rate in milliseconds for debounced watchers (only used when useDebounce is true).
45
- * Controls how frequently the debouncer checks for events to process.
46
- * When not specified, the debouncer will auto-select an appropriate tick rate (1/4 of the debounce duration).
47
- * @default undefined (auto-select)
48
- */
45
+ * Tick rate in milliseconds for debounced watchers (only used when useDebounce is true).
46
+ * Controls how frequently the debouncer checks for events to process.
47
+ * When not specified, the debouncer will auto-select an appropriate tick rate (1/4 of the debounce duration).
48
+ * @default undefined (auto-select)
49
+ */
49
50
  debounceTickRate?: number;
50
51
  }
51
52
  interface DevOptions {
52
53
  onHmrUpdates?: DevOnHmrUpdates;
53
54
  onOutput?: DevOnOutput;
54
55
  /**
55
- * Strategy for triggering rebuilds after HMR updates.
56
- * - `'always'`: Always trigger a rebuild after HMR updates
57
- * - `'auto'`: Trigger rebuild only if HMR updates contain full reload updates
58
- * - `'never'`: Never trigger rebuild after HMR updates (default)
59
- * @default 'auto'
60
- */
56
+ * Strategy for triggering rebuilds after HMR updates.
57
+ * - `'always'`: Always trigger a rebuild after HMR updates
58
+ * - `'auto'`: Trigger rebuild only if HMR updates contain full reload updates
59
+ * - `'never'`: Never trigger rebuild after HMR updates (default)
60
+ * @default 'auto'
61
+ */
61
62
  rebuildStrategy?: "always" | "auto" | "never";
62
63
  watch?: DevWatchOptions;
63
64
  }
@@ -76,16 +77,16 @@ declare class DevEngine {
76
77
  removeClient(clientId: string): Promise<void>;
77
78
  close(): Promise<void>;
78
79
  /**
79
- * Compile a lazy entry module and return HMR-style patch code.
80
- *
81
- * This is called when a dynamically imported module is first requested at runtime.
82
- * The module was previously stubbed with a proxy, and now we need to compile the
83
- * actual module and its dependencies.
84
- *
85
- * @param moduleId - The absolute file path of the module to compile
86
- * @param clientId - The client ID requesting this compilation
87
- * @returns The compiled JavaScript code as a string (HMR patch format)
88
- */
80
+ * Compile a lazy entry module and return HMR-style patch code.
81
+ *
82
+ * This is called when a dynamically imported module is first requested at runtime.
83
+ * The module was previously stubbed with a proxy, and now we need to compile the
84
+ * actual module and its dependencies.
85
+ *
86
+ * @param moduleId - The absolute file path of the module to compile
87
+ * @param clientId - The client ID requesting this compilation
88
+ * @returns The compiled JavaScript code as a string (HMR patch format)
89
+ */
89
90
  compileEntry(moduleId: string, clientId: string): Promise<string>;
90
91
  }
91
92
  //#endregion
@@ -110,16 +111,6 @@ declare const dev: typeof DevEngine.create;
110
111
  */
111
112
  declare const scan: (rawInputOptions: InputOptions, rawOutputOptions?: {}) => Promise<Promise<void>>;
112
113
  //#endregion
113
- //#region src/utils/parse.d.ts
114
- /**
115
- * Parse asynchronously.
116
- *
117
- * Note: This function can be slower than `parseSync` due to the overhead of spawning a thread.
118
- */
119
- declare function parse(filename: string, sourceText: string, options?: ParserOptions | null): Promise<ParseResult>;
120
- /** Parse synchronously. */
121
- declare function parseSync(filename: string, sourceText: string, options?: ParserOptions | null): ParseResult;
122
- //#endregion
123
114
  //#region src/builtin-plugin/alias-plugin.d.ts
124
115
  type ViteAliasPluginConfig = {
125
116
  entries: {
@@ -129,6 +120,57 @@ type ViteAliasPluginConfig = {
129
120
  };
130
121
  declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
131
122
  //#endregion
123
+ //#region src/builtin-plugin/bundle-analyzer-plugin.d.ts
124
+ /**
125
+ * A plugin that analyzes bundle composition and generates detailed reports.
126
+ *
127
+ * The plugin outputs a file containing detailed information about:
128
+ * - All chunks and their relationships
129
+ * - Modules bundled in each chunk
130
+ * - Import dependencies between chunks
131
+ * - Reachable modules from each entry point
132
+ *
133
+ * @example
134
+ * ```js
135
+ * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
136
+ *
137
+ * export default {
138
+ * plugins: [
139
+ * bundleAnalyzerPlugin()
140
+ * ]
141
+ * }
142
+ * ```
143
+ *
144
+ * @example
145
+ * **Custom filename**
146
+ * ```js
147
+ * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
148
+ *
149
+ * export default {
150
+ * plugins: [
151
+ * bundleAnalyzerPlugin({
152
+ * fileName: 'bundle-analysis.json'
153
+ * })
154
+ * ]
155
+ * }
156
+ * ```
157
+ *
158
+ * @example
159
+ * **LLM-friendly markdown output**
160
+ * ```js
161
+ * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
162
+ *
163
+ * export default {
164
+ * plugins: [
165
+ * bundleAnalyzerPlugin({
166
+ * format: 'md'
167
+ * })
168
+ * ]
169
+ * }
170
+ * ```
171
+ */
172
+ declare function bundleAnalyzerPlugin(config?: BindingBundleAnalyzerPluginConfig): BuiltinPlugin;
173
+ //#endregion
132
174
  //#region src/builtin-plugin/transform-plugin.d.ts
133
175
  type TransformPattern = string | RegExp | readonly (RegExp | string)[];
134
176
  type TransformPluginConfig = Omit<BindingViteTransformPluginConfig, "include" | "exclude" | "jsxRefreshInclude" | "jsxRefreshExclude" | "yarnPnp"> & {
@@ -145,6 +187,69 @@ type ViteManifestPluginConfig = Omit<BindingViteManifestPluginConfig, "isLegacy"
145
187
  };
146
188
  declare function viteManifestPlugin(config: ViteManifestPluginConfig): BuiltinPlugin;
147
189
  //#endregion
190
+ //#region src/builtin-plugin/rollipop-react-refresh-wrapper-plugin.d.ts
191
+ declare function rollipopReactRefreshWrapperPlugin(config: BindingRollipopReactRefreshWrapperPluginConfig): BuiltinPlugin;
192
+ //#endregion
193
+ //#region src/builtin-plugin/rollipop-worklets-plugin.d.ts
194
+ declare function rollipopWorkletsPlugin(config: BindingRollipopWorkletsPluginConfig): BuiltinPlugin;
195
+ //#endregion
196
+ //#region src/builtin-plugin/rollipop-react-native-plugin.d.ts
197
+ type RollipopReactNativeRuntimeTarget = "Hermes" | "HermesV1";
198
+ /**
199
+ * `react-native-worklets` transform configuration. Field semantics mirror
200
+ * the upstream Babel plugin's `WorkletsOptions`, minus the rolldown-managed
201
+ * fields (`filename`, `cwd`). Pass `worklets: {}` to opt in with defaults;
202
+ * omit the field entirely to skip the visitor.
203
+ */
204
+ interface RollipopReactNativeWorkletsConfig {
205
+ /** Identifiers treated as globals — never captured into worklet closures. */
206
+ globals?: string[];
207
+ /** When `true`, only the names listed in `globals` are considered safe. */
208
+ strictGlobal?: boolean;
209
+ /** Omit native-only data (`init_data`) from the output. Useful for web builds. */
210
+ omitNativeOnlyData?: boolean;
211
+ /** Disable source map generation for worklets. */
212
+ disableSourceMaps?: boolean;
213
+ /** Use paths relative to `cwd` for source locations. */
214
+ relativeSourceLocation?: boolean;
215
+ /** Disable Worklet Classes support. */
216
+ disableWorkletClasses?: boolean;
217
+ /** Suppress the inline-shared-values warning. */
218
+ disableInlineStylesWarning?: boolean;
219
+ /** Enable Bundle Mode. */
220
+ bundleMode?: boolean;
221
+ /** Release builds skip debug info such as stack details, version, and location. */
222
+ isRelease?: boolean;
223
+ /** Version string emitted as `__pluginVersion` (the installed `react-native-worklets` version). */
224
+ pluginVersion?: string;
225
+ }
226
+ /**
227
+ * Flow handling configuration. Mirrors Babel's
228
+ * `@babel/plugin-transform-flow-strip-types` semantics.
229
+ */
230
+ interface RollipopReactNativeFlowConfig {
231
+ /**
232
+ * When `true`, only files containing `@flow` or `@noflow` directive comments are parsed as Flow (Babel `requireDirective: true`).
233
+ * When `false` (default), every JS module is parsed as Flow regardless of directive — matches Metro / Babel default behavior.
234
+ */
235
+ requireDirective?: boolean;
236
+ }
237
+ interface RollipopReactNativePluginConfig {
238
+ runtimeTarget?: RollipopReactNativeRuntimeTarget;
239
+ /**
240
+ * The name of the `env` to use when loading configs and plugins. Defaults
241
+ * to the value of `SWC_ENV`, or else `NODE_ENV`, or else `"development"`.
242
+ */
243
+ envName?: string;
244
+ /** `react-native-worklets` transform. Visitor is skipped when omitted. */
245
+ worklets?: RollipopReactNativeWorkletsConfig;
246
+ /** SWC plugins to load. */
247
+ plugins?: [string, Record<string, unknown>][];
248
+ /** Flow handling configuration. Defaults match Metro / Babel behavior. */
249
+ flow?: RollipopReactNativeFlowConfig;
250
+ }
251
+ declare function rollipopReactNativePlugin(config?: RollipopReactNativePluginConfig): BuiltinPlugin;
252
+ //#endregion
148
253
  //#region src/experimental-index.d.ts
149
254
  /**
150
255
  * In-memory file system for browser builds.
@@ -177,5 +282,35 @@ declare const memfs: {
177
282
  fs: any;
178
283
  volume: any;
179
284
  } | undefined;
285
+ /** @deprecated Use from `rolldown/utils` instead. */
286
+ declare const parse: typeof parse$1;
287
+ /** @deprecated Use from `rolldown/utils` instead. */
288
+ declare const parseSync: typeof parseSync$1;
289
+ /** @deprecated Use from `rolldown/utils` instead. */
290
+ type ParseResult = ParseResult$1;
291
+ /** @deprecated Use from `rolldown/utils` instead. */
292
+ type ParserOptions = ParserOptions$1;
293
+ /** @deprecated Use from `rolldown/utils` instead. */
294
+ declare const minify: typeof minify$1;
295
+ /** @deprecated Use from `rolldown/utils` instead. */
296
+ declare const minifySync: typeof minifySync$1;
297
+ /** @deprecated Use from `rolldown/utils` instead. */
298
+ type MinifyOptions = MinifyOptions$1;
299
+ /** @deprecated Use from `rolldown/utils` instead. */
300
+ type MinifyResult = MinifyResult$1;
301
+ /** @deprecated Use from `rolldown/utils` instead. */
302
+ declare const transform: typeof transform$1;
303
+ /** @deprecated Use from `rolldown/utils` instead. */
304
+ declare const transformSync: typeof transformSync$1;
305
+ /** @deprecated Use from `rolldown/utils` instead. */
306
+ type TransformOptions = TransformOptions$1;
307
+ /** @deprecated Use from `rolldown/utils` instead. */
308
+ type TransformResult = TransformResult$1;
309
+ /** @deprecated Use from `rolldown/utils` instead. */
310
+ declare const TsconfigCache: typeof TsconfigCache$1;
311
+ /** @deprecated Use from `rolldown/utils` instead. */
312
+ type TsconfigRawOptions = BindingTsconfigRawOptions;
313
+ /** @deprecated Use from `rolldown/utils` instead. */
314
+ type TsconfigCompilerOptions = BindingTsconfigCompilerOptions;
180
315
  //#endregion
181
- export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type MinifyOptions, type MinifyResult, type ParseResult, type ParserOptions, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, createTokioRuntime, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWasmHelperPlugin, viteWebWorkerPostPlugin };
316
+ export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, MinifyOptions, MinifyResult, ParseResult, ParserOptions, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type RollipopReactNativeFlowConfig, type RollipopReactNativePluginConfig, type RollipopReactNativeRuntimeTarget, type RollipopReactNativeWorkletsConfig, type BindingRollipopReactRefreshWrapperPluginConfig as RollipopReactRefreshWrapperPluginConfig, type BindingRollipopWorkletsPluginConfig as RollipopWorkletsPluginConfig, TransformOptions, TransformResult, TsconfigCache, TsconfigCompilerOptions, TsconfigRawOptions, bundleAnalyzerPlugin, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, oxcRuntimePlugin, parse, parseSync, resolveTsconfig, rollipopReactNativePlugin, rollipopReactRefreshWrapperPlugin, rollipopWorkletsPlugin, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWebWorkerPostPlugin };
@@ -1,11 +1,12 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-tNJoEqAa.mjs";
2
- import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-DeB7vQ75.mjs";
3
- import { c as transformToRollupOutput, o as normalizeBindingResult, s as unwrapBindingResult } from "./shared/bindingify-input-options-CfhrNd_y.mjs";
4
- import { l as PluginDriver, n as createBundlerOptions, s as validateOption, t as RolldownBuild } from "./shared/rolldown-build-DWeKtJOy.mjs";
5
- import { i as parseSync, r as parse } from "./shared/parse-ast-index-BcP4Ts_P.mjs";
6
- import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWasmHelperPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./shared/constructors-414MPkgB.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-D_jQsHun.mjs";
2
+ import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-B8PEhdn1.mjs";
3
+ import { o as transformToRollupOutput } from "./shared/bindingify-input-options-DfXGy4QO.mjs";
4
+ import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-80GULIOI.mjs";
5
+ import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-D5tMcn3l.mjs";
6
+ import { n as parseSync$1, t as parse$1 } from "./shared/parse-iQx2ihYn.mjs";
7
+ import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWasmFallbackPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-B-HbV10G.mjs";
8
+ import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-CxoM-bno.mjs";
7
9
  import { pathToFileURL } from "node:url";
8
-
9
10
  //#region src/api/dev/dev-engine.ts
10
11
  var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
11
12
  var DevEngine = class DevEngine {
@@ -98,11 +99,9 @@ var DevEngine = class DevEngine {
98
99
  return this.#inner.compileEntry(moduleId, clientId);
99
100
  }
100
101
  };
101
-
102
102
  //#endregion
103
103
  //#region src/api/dev/index.ts
104
104
  const dev = (...args) => DevEngine.create(...args);
105
-
106
105
  //#endregion
107
106
  //#region src/types/external-memory-handle.ts
108
107
  const symbolForExternalMemoryHandle = "__rolldown_external_memory_handle__";
@@ -143,7 +142,6 @@ const symbolForExternalMemoryHandle = "__rolldown_external_memory_handle__";
143
142
  function freeExternalMemory(handle, keepDataAlive = false) {
144
143
  return handle[symbolForExternalMemoryHandle](keepDataAlive);
145
144
  }
146
-
147
145
  //#endregion
148
146
  //#region src/api/experimental.ts
149
147
  /**
@@ -184,7 +182,6 @@ const scan = async (rawInputOptions, rawOutputOptions = {}) => {
184
182
  }
185
183
  return cleanupPromise;
186
184
  };
187
-
188
185
  //#endregion
189
186
  //#region src/plugin/parallel-plugin.ts
190
187
  function defineParallelPlugin(pluginPath) {
@@ -195,13 +192,64 @@ function defineParallelPlugin(pluginPath) {
195
192
  } };
196
193
  };
197
194
  }
198
-
199
195
  //#endregion
200
196
  //#region src/builtin-plugin/alias-plugin.ts
201
197
  function viteAliasPlugin(config) {
202
198
  return new BuiltinPlugin("builtin:vite-alias", config);
203
199
  }
204
-
200
+ //#endregion
201
+ //#region src/builtin-plugin/bundle-analyzer-plugin.ts
202
+ /**
203
+ * A plugin that analyzes bundle composition and generates detailed reports.
204
+ *
205
+ * The plugin outputs a file containing detailed information about:
206
+ * - All chunks and their relationships
207
+ * - Modules bundled in each chunk
208
+ * - Import dependencies between chunks
209
+ * - Reachable modules from each entry point
210
+ *
211
+ * @example
212
+ * ```js
213
+ * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
214
+ *
215
+ * export default {
216
+ * plugins: [
217
+ * bundleAnalyzerPlugin()
218
+ * ]
219
+ * }
220
+ * ```
221
+ *
222
+ * @example
223
+ * **Custom filename**
224
+ * ```js
225
+ * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
226
+ *
227
+ * export default {
228
+ * plugins: [
229
+ * bundleAnalyzerPlugin({
230
+ * fileName: 'bundle-analysis.json'
231
+ * })
232
+ * ]
233
+ * }
234
+ * ```
235
+ *
236
+ * @example
237
+ * **LLM-friendly markdown output**
238
+ * ```js
239
+ * import { bundleAnalyzerPlugin } from 'rolldown/experimental';
240
+ *
241
+ * export default {
242
+ * plugins: [
243
+ * bundleAnalyzerPlugin({
244
+ * format: 'md'
245
+ * })
246
+ * ]
247
+ * }
248
+ * ```
249
+ */
250
+ function bundleAnalyzerPlugin(config) {
251
+ return new BuiltinPlugin("builtin:bundle-analyzer", config);
252
+ }
205
253
  //#endregion
206
254
  //#region src/builtin-plugin/transform-plugin.ts
207
255
  function viteTransformPlugin(config) {
@@ -214,13 +262,41 @@ function viteTransformPlugin(config) {
214
262
  yarnPnp: typeof process === "object" && !!process.versions?.pnp
215
263
  });
216
264
  }
217
-
218
265
  //#endregion
219
266
  //#region src/builtin-plugin/vite-manifest-plugin.ts
220
267
  function viteManifestPlugin(config) {
221
268
  return new BuiltinPlugin("builtin:vite-manifest", config);
222
269
  }
223
-
270
+ //#endregion
271
+ //#region src/builtin-plugin/rollipop-react-refresh-wrapper-plugin.ts
272
+ function rollipopReactRefreshWrapperPlugin(config) {
273
+ return new BuiltinPlugin("builtin:rollipop-react-refresh-wrapper", {
274
+ cwd: config.cwd,
275
+ include: normalizedStringOrRegex(config.include),
276
+ exclude: normalizedStringOrRegex(config.exclude),
277
+ jsxImportSource: config.jsxImportSource
278
+ });
279
+ }
280
+ //#endregion
281
+ //#region src/builtin-plugin/rollipop-worklets-plugin.ts
282
+ function rollipopWorkletsPlugin(config) {
283
+ return new BuiltinPlugin("builtin:rollipop-worklets", config);
284
+ }
285
+ //#endregion
286
+ //#region src/builtin-plugin/rollipop-react-native-plugin.ts
287
+ function rollipopReactNativePlugin(config) {
288
+ const plugins = config?.plugins?.map(([path, pluginConfig]) => ({
289
+ path,
290
+ config: JSON.stringify(pluginConfig ?? {})
291
+ }));
292
+ return new BuiltinPlugin("builtin:rollipop-react-native", {
293
+ runtimeTarget: config?.runtimeTarget,
294
+ envName: config?.envName,
295
+ flow: config?.flow,
296
+ worklets: config?.worklets,
297
+ plugins
298
+ });
299
+ }
224
300
  //#endregion
225
301
  //#region src/experimental-index.ts
226
302
  /**
@@ -251,16 +327,24 @@ function viteManifestPlugin(config) {
251
327
  * @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
252
328
  */
253
329
  const memfs = void 0;
254
-
330
+ /** @deprecated Use from `rolldown/utils` instead. */
331
+ const parse = parse$1;
332
+ /** @deprecated Use from `rolldown/utils` instead. */
333
+ const parseSync = parseSync$1;
334
+ /** @deprecated Use from `rolldown/utils` instead. */
335
+ const minify = minify$1;
336
+ /** @deprecated Use from `rolldown/utils` instead. */
337
+ const minifySync = minifySync$1;
338
+ /** @deprecated Use from `rolldown/utils` instead. */
339
+ const transform = transform$1;
340
+ /** @deprecated Use from `rolldown/utils` instead. */
341
+ const transformSync = transformSync$1;
342
+ /** @deprecated Use from `rolldown/utils` instead. */
343
+ const TsconfigCache = TsconfigCache$1;
255
344
  //#endregion
256
345
  var BindingRebuildStrategy = import_binding.BindingRebuildStrategy;
257
346
  var ResolverFactory = import_binding.ResolverFactory;
258
- var createTokioRuntime = import_binding.createTokioRuntime;
259
347
  var isolatedDeclaration = import_binding.isolatedDeclaration;
260
348
  var isolatedDeclarationSync = import_binding.isolatedDeclarationSync;
261
- var minify = import_binding.minify;
262
- var minifySync = import_binding.minifySync;
263
349
  var moduleRunnerTransform = import_binding.moduleRunnerTransform;
264
- var transform = import_binding.transform;
265
- var transformSync = import_binding.transformSync;
266
- export { BindingRebuildStrategy, DevEngine, ResolverFactory, createTokioRuntime, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWasmHelperPlugin, viteWebWorkerPostPlugin };
350
+ export { BindingRebuildStrategy, DevEngine, ResolverFactory, TsconfigCache, bundleAnalyzerPlugin, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, oxcRuntimePlugin, parse, parseSync, resolveTsconfig, rollipopReactNativePlugin, rollipopReactRefreshWrapperPlugin, rollipopWorkletsPlugin, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWebWorkerPostPlugin };
@@ -69,12 +69,7 @@ export class DevRuntime {
69
69
  __toDynamicImportESM: (isNodeMode?: boolean) => (mod: any) => any;
70
70
  /** @internal */
71
71
  __reExport: any;
72
- cache: string[];
73
- timeout: NodeJS.Timeout | null;
74
- timeoutSetLength: number;
75
- /** @type {(module: string) => void} */
76
72
  sendModuleRegisteredMessage: (module: string) => void;
77
- flush(): void;
78
73
  }
79
74
  export type DevRuntimeMessage = {
80
75
  type: "hmr:module-registered";
@@ -1,5 +1,4 @@
1
- import "./shared/binding-B92Lq__Q.mjs";
2
- import { j as withFilter } from "./shared/define-config-D8xP5iyL.mjs";
1
+ import { M as withFilter } from "./shared/define-config-BSxBeCq6.mjs";
3
2
 
4
3
  //#region ../pluginutils/dist/filter/composable-filters.d.ts
5
4
  type StringOrRegExp = string | RegExp;
@@ -1,5 +1,4 @@
1
- import { n as isPromiseLike, t as arraify } from "./shared/misc-CCZIsXVO.mjs";
2
-
1
+ import { n as isPromiseLike, t as arraify } from "./shared/misc-DJYbNKZX.mjs";
3
2
  //#region ../pluginutils/dist/utils.js
4
3
  const postfixRE = /[?#].*$/;
5
4
  function cleanUrl(url) {
@@ -12,7 +11,6 @@ function extractQueryWithoutFragment(url) {
12
11
  if (fragmentIndex === -1) return url.substring(questionMarkIndex);
13
12
  else return url.substring(questionMarkIndex, fragmentIndex);
14
13
  }
15
-
16
14
  //#endregion
17
15
  //#region ../pluginutils/dist/filter/composable-filters.js
18
16
  var And = class {
@@ -203,7 +201,6 @@ function exprInterpreter(expr, code, id, moduleType, importerId, ctx = {}) {
203
201
  default: throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`);
204
202
  }
205
203
  }
206
-
207
204
  //#endregion
208
205
  //#region ../pluginutils/dist/filter/filter-vite-plugins.js
209
206
  /**
@@ -260,7 +257,6 @@ function filterVitePlugins(plugins) {
260
257
  }
261
258
  return result;
262
259
  }
263
-
264
260
  //#endregion
265
261
  //#region ../pluginutils/dist/filter/simple-filters.js
266
262
  /**
@@ -324,7 +320,6 @@ function makeIdFilterToMatchWithQuery(input) {
324
320
  function makeRegexIdFilterToMatchWithQuery(input) {
325
321
  return new RegExp(input.source.replace(/(?<!\\)\$/g, "(?:\\?.*)?$"), input.flags);
326
322
  }
327
-
328
323
  //#endregion
329
324
  //#region src/plugin/with-filter.ts
330
325
  function withFilterImpl(pluginOption, filterObjectList) {
@@ -352,6 +347,29 @@ function withFilterImpl(pluginOption, filterObjectList) {
352
347
  });
353
348
  return plugin;
354
349
  }
350
+ /**
351
+ * A helper function to add plugin hook filters to a plugin or an array of plugins.
352
+ *
353
+ * @example
354
+ * ```ts
355
+ * import yaml from '@rollup/plugin-yaml';
356
+ * import { defineConfig } from 'rolldown';
357
+ * import { withFilter } from 'rolldown/filter';
358
+ *
359
+ * export default defineConfig({
360
+ * plugins: [
361
+ * // Run the transform hook of the `yaml` plugin
362
+ * // only for modules which end in `.yaml`
363
+ * withFilter(
364
+ * yaml({}),
365
+ * { transform: { id: /\.yaml$/ } },
366
+ * ),
367
+ * ],
368
+ * });
369
+ * ```
370
+ *
371
+ * @category Config
372
+ */
355
373
  function withFilter(pluginOption, filterObject) {
356
374
  return withFilterImpl(pluginOption, arraify(filterObject));
357
375
  }
@@ -364,6 +382,5 @@ function findMatchedFilterObject(pluginName, overrideFilterObjectList) {
364
382
  }
365
383
  return -1;
366
384
  }
367
-
368
385
  //#endregion
369
- export { and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query, withFilter };
386
+ export { and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query, withFilter };
@@ -1,7 +1,3 @@
1
- import { a as RolldownLog } from "./shared/logging-wIy4zY9I.mjs";
2
-
3
- //#region src/get-log-filter.d.ts
4
- type GetLogFilter = (filters: string[]) => (log: RolldownLog) => boolean;
5
- declare const getLogFilter: GetLogFilter;
6
- //#endregion
7
- export { GetLogFilter, type RolldownLog, type RolldownLog as RollupLog, getLogFilter as default };
1
+ import { a as RolldownLog } from "./shared/logging-C6h4g8dA.mjs";
2
+ import { n as getLogFilter, t as GetLogFilter } from "./shared/get-log-filter-semyr3Lj.mjs";
3
+ export { GetLogFilter, RolldownLog, RolldownLog as RollupLog, getLogFilter as default };