@rollipop/rolldown 0.0.0-beta.3 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cli-setup.mjs +1 -1
  2. package/dist/cli.mjs +121 -114
  3. package/dist/config.d.mts +2 -2
  4. package/dist/config.mjs +8 -8
  5. package/dist/experimental-index.d.mts +43 -43
  6. package/dist/experimental-index.mjs +6 -6
  7. package/dist/filter-index.d.mts +197 -4
  8. package/dist/filter-index.mjs +1 -1
  9. package/dist/get-log-filter.d.mts +3 -3
  10. package/dist/index.d.mts +4 -4
  11. package/dist/index.mjs +27 -8
  12. package/dist/parallel-plugin-worker.mjs +4 -4
  13. package/dist/parallel-plugin.d.mts +4 -4
  14. package/dist/parse-ast-index.d.mts +1 -1
  15. package/dist/parse-ast-index.mjs +2 -2
  16. package/dist/plugins-index.d.mts +3 -4
  17. package/dist/plugins-index.mjs +3 -3
  18. package/dist/shared/binding-B92Lq__Q.d.mts +1687 -0
  19. package/dist/shared/{binding-uOeDeDzp.mjs → binding-tNJoEqAa.mjs} +28 -26
  20. package/dist/shared/{bindingify-input-options-CuBDHglZ.mjs → bindingify-input-options-CfhrNd_y.mjs} +117 -58
  21. package/dist/shared/{constructors-D9F4Aj4h.d.mts → constructors--k1uxZrh.d.mts} +2 -2
  22. package/dist/shared/{constructors-DmSv3tnW.mjs → constructors-414MPkgB.mjs} +1 -1
  23. package/dist/shared/define-config-D8xP5iyL.d.mts +3463 -0
  24. package/dist/shared/{load-config-Bo3y98vw.mjs → load-config-Qtd9pHJ5.mjs} +1 -1
  25. package/dist/shared/logging-wIy4zY9I.d.mts +50 -0
  26. package/dist/shared/{normalize-string-or-regex-0f6WITto.mjs → normalize-string-or-regex-DeB7vQ75.mjs} +2 -2
  27. package/dist/shared/{parse-ast-index-B0iVLbj6.mjs → parse-ast-index-BcP4Ts_P.mjs} +3 -3
  28. package/dist/shared/{prompt-BZ-QjPVS.mjs → prompt-tlfjalEt.mjs} +1 -1
  29. package/dist/shared/rolldown-BMzJcmQ7.mjs +42 -0
  30. package/dist/shared/{rolldown-build-BqHWBpp7.mjs → rolldown-build-DWeKtJOy.mjs} +123 -47
  31. package/dist/shared/{watch-Ce8bKBAn.mjs → watch-HmN4U4B9.mjs} +34 -6
  32. package/package.json +18 -16
  33. package/dist/shared/binding-C9YdqoUG.d.mts +0 -1657
  34. package/dist/shared/define-config-glNgjHCc.d.mts +0 -2573
  35. package/dist/shared/logging-DsnCZi19.d.mts +0 -42
  36. package/dist/shared/rolldown-mAJGca5O.mjs +0 -11
  37. /package/dist/shared/{define-config-BF4P-Pum.mjs → define-config-BVG4QvnP.mjs} +0 -0
  38. /package/dist/shared/{logs-N5Akftom.mjs → logs-NH298mHo.mjs} +0 -0
  39. /package/dist/shared/{misc-0HsaOsAX.mjs → misc-CCZIsXVO.mjs} +0 -0
@@ -1,4 +1,197 @@
1
- import "./shared/binding-C9YdqoUG.mjs";
2
- import { j as withFilter } from "./shared/define-config-glNgjHCc.mjs";
3
- export * from "@rollipop/rolldown-pluginutils/filter";
4
- export { withFilter };
1
+ import "./shared/binding-B92Lq__Q.mjs";
2
+ import { j as withFilter } from "./shared/define-config-D8xP5iyL.mjs";
3
+
4
+ //#region ../pluginutils/dist/filter/composable-filters.d.ts
5
+ type StringOrRegExp = string | RegExp;
6
+ type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
7
+ type FilterExpressionKind = FilterExpression['kind'];
8
+ type FilterExpression = And | Or | Not | Id | ImporterId | ModuleType | Code | Query;
9
+ type TopLevelFilterExpression = Include | Exclude;
10
+ declare class And {
11
+ kind: 'and';
12
+ args: FilterExpression[];
13
+ constructor(...args: FilterExpression[]);
14
+ }
15
+ declare class Or {
16
+ kind: 'or';
17
+ args: FilterExpression[];
18
+ constructor(...args: FilterExpression[]);
19
+ }
20
+ declare class Not {
21
+ kind: 'not';
22
+ expr: FilterExpression;
23
+ constructor(expr: FilterExpression);
24
+ }
25
+ interface QueryFilterObject {
26
+ [key: string]: StringOrRegExp | boolean;
27
+ }
28
+ interface IdParams {
29
+ cleanUrl?: boolean;
30
+ }
31
+ declare class Id {
32
+ kind: 'id';
33
+ pattern: StringOrRegExp;
34
+ params: IdParams;
35
+ constructor(pattern: StringOrRegExp, params?: IdParams);
36
+ }
37
+ declare class ImporterId {
38
+ kind: 'importerId';
39
+ pattern: StringOrRegExp;
40
+ params: IdParams;
41
+ constructor(pattern: StringOrRegExp, params?: IdParams);
42
+ }
43
+ declare class ModuleType {
44
+ kind: 'moduleType';
45
+ pattern: PluginModuleType;
46
+ constructor(pattern: PluginModuleType);
47
+ }
48
+ declare class Code {
49
+ kind: 'code';
50
+ pattern: StringOrRegExp;
51
+ constructor(expr: StringOrRegExp);
52
+ }
53
+ declare class Query {
54
+ kind: 'query';
55
+ key: string;
56
+ pattern: StringOrRegExp | boolean;
57
+ constructor(key: string, pattern: StringOrRegExp | boolean);
58
+ }
59
+ declare class Include {
60
+ kind: 'include';
61
+ expr: FilterExpression;
62
+ constructor(expr: FilterExpression);
63
+ }
64
+ declare class Exclude {
65
+ kind: 'exclude';
66
+ expr: FilterExpression;
67
+ constructor(expr: FilterExpression);
68
+ }
69
+ declare function and(...args: FilterExpression[]): And;
70
+ declare function or(...args: FilterExpression[]): Or;
71
+ declare function not(expr: FilterExpression): Not;
72
+ declare function id(pattern: StringOrRegExp, params?: IdParams): Id;
73
+ declare function importerId(pattern: StringOrRegExp, params?: IdParams): ImporterId;
74
+ declare function moduleType(pattern: PluginModuleType): ModuleType;
75
+ declare function code(pattern: StringOrRegExp): Code;
76
+ declare function query(key: string, pattern: StringOrRegExp | boolean): Query;
77
+ declare function include(expr: FilterExpression): Include;
78
+ declare function exclude(expr: FilterExpression): Exclude;
79
+ /**
80
+ * convert a queryObject to FilterExpression like
81
+ * ```js
82
+ * and(query(k1, v1), query(k2, v2))
83
+ * ```
84
+ * @param queryFilterObject The query filter object needs to be matched.
85
+ * @returns a `And` FilterExpression
86
+ */
87
+ declare function queries(queryFilter: QueryFilterObject): And;
88
+ declare function interpreter(exprs: TopLevelFilterExpression | TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string): boolean;
89
+ interface InterpreterCtx {
90
+ urlSearchParamsCache?: URLSearchParams;
91
+ }
92
+ declare function interpreterImpl(expr: TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
93
+ declare function exprInterpreter(expr: FilterExpression, code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
94
+ //#endregion
95
+ //#region ../pluginutils/dist/filter/filter-vite-plugins.d.ts
96
+ /**
97
+ * Filters out Vite plugins that have `apply: 'serve'` set.
98
+ *
99
+ * Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
100
+ * are intended only for Vite's dev server and should be excluded from the build process.
101
+ *
102
+ * @param plugins - Array of plugins (can include nested arrays)
103
+ * @returns Filtered array with serve-only plugins removed
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * import { defineConfig } from '@rollipop/rolldown';
108
+ * import { filterVitePlugins } from '@rolldown/pluginutils';
109
+ * import viteReact from '@vitejs/plugin-react';
110
+ *
111
+ * export default defineConfig({
112
+ * plugins: filterVitePlugins([
113
+ * viteReact(),
114
+ * {
115
+ * name: 'dev-only',
116
+ * apply: 'serve', // This will be filtered out
117
+ * // ...
118
+ * }
119
+ * ])
120
+ * });
121
+ * ```
122
+ */
123
+ declare function filterVitePlugins<T = any>(plugins: T | T[] | null | undefined | false): T[];
124
+ //#endregion
125
+ //#region ../pluginutils/dist/filter/simple-filters.d.ts
126
+ /**
127
+ * Constructs a RegExp that matches the exact string specified.
128
+ *
129
+ * This is useful for plugin hook filters.
130
+ *
131
+ * @param str the string to match.
132
+ * @param flags flags for the RegExp.
133
+ *
134
+ * @example
135
+ * ```ts
136
+ * import { exactRegex } from '@rolldown/pluginutils';
137
+ * const plugin = {
138
+ * name: 'plugin',
139
+ * resolveId: {
140
+ * filter: { id: exactRegex('foo') },
141
+ * handler(id) {} // will only be called for `foo`
142
+ * }
143
+ * }
144
+ * ```
145
+ */
146
+ declare function exactRegex(str: string, flags?: string): RegExp;
147
+ /**
148
+ * Constructs a RegExp that matches a value that has the specified prefix.
149
+ *
150
+ * This is useful for plugin hook filters.
151
+ *
152
+ * @param str the string to match.
153
+ * @param flags flags for the RegExp.
154
+ *
155
+ * @example
156
+ * ```ts
157
+ * import { prefixRegex } from '@rolldown/pluginutils';
158
+ * const plugin = {
159
+ * name: 'plugin',
160
+ * resolveId: {
161
+ * filter: { id: prefixRegex('foo') },
162
+ * handler(id) {} // will only be called for IDs starting with `foo`
163
+ * }
164
+ * }
165
+ * ```
166
+ */
167
+ declare function prefixRegex(str: string, flags?: string): RegExp;
168
+ type WidenString<T> = T extends string ? string : T;
169
+ /**
170
+ * Converts a id filter to match with an id with a query.
171
+ *
172
+ * @param input the id filters to convert.
173
+ *
174
+ * @example
175
+ * ```ts
176
+ * import { makeIdFiltersToMatchWithQuery } from '@rolldown/pluginutils';
177
+ * const plugin = {
178
+ * name: 'plugin',
179
+ * transform: {
180
+ * filter: { id: makeIdFiltersToMatchWithQuery(['**' + '/*.js', /\.ts$/]) },
181
+ * // The handler will be called for IDs like:
182
+ * // - foo.js
183
+ * // - foo.js?foo
184
+ * // - foo.txt?foo.js
185
+ * // - foo.ts
186
+ * // - foo.ts?foo
187
+ * // - foo.txt?foo.ts
188
+ * handler(code, id) {}
189
+ * }
190
+ * }
191
+ * ```
192
+ */
193
+ declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: T): WidenString<T>;
194
+ declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: readonly T[]): WidenString<T>[];
195
+ declare function makeIdFiltersToMatchWithQuery(input: string | RegExp | readonly (string | RegExp)[]): string | RegExp | (string | RegExp)[];
196
+ //#endregion
197
+ export { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query, withFilter };
@@ -1,4 +1,4 @@
1
- import { n as isPromiseLike, t as arraify } from "./shared/misc-0HsaOsAX.mjs";
1
+ import { n as isPromiseLike, t as arraify } from "./shared/misc-CCZIsXVO.mjs";
2
2
 
3
3
  //#region ../pluginutils/dist/utils.js
4
4
  const postfixRE = /[?#].*$/;
@@ -1,7 +1,7 @@
1
- import { a as RollupLog } from "./shared/logging-DsnCZi19.mjs";
1
+ import { a as RolldownLog } from "./shared/logging-wIy4zY9I.mjs";
2
2
 
3
3
  //#region src/get-log-filter.d.ts
4
- type GetLogFilter = (filters: string[]) => (log: RollupLog) => boolean;
4
+ type GetLogFilter = (filters: string[]) => (log: RolldownLog) => boolean;
5
5
  declare const getLogFilter: GetLogFilter;
6
6
  //#endregion
7
- export { GetLogFilter, type RollupLog, getLogFilter as default };
7
+ export { GetLogFilter, type RolldownLog, type RolldownLog as RollupLog, getLogFilter as default };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as RollupLog, i as RollupError, n as LogLevelOption, o as RollupLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-DsnCZi19.mjs";
2
- import { P as PreRenderedChunk, s as BindingMagicString } from "./shared/binding-C9YdqoUG.mjs";
3
- import { $ as RolldownFileStats, A as TransformResult, B as EmittedFile, C as Plugin, Ct as GlobalsFunction, D as RolldownPlugin, Dt as PreRenderedAsset, E as ResolvedId, Et as OutputOptions, F as SourceMapInput, Ft as RolldownOutput, H as GetModuleInfo, I as OutputBundle, It as SourceMap, J as GeneralHookFilter, K as MinimalPluginContext, L as TreeshakingOptions, Mt as OutputChunk, N as VERSION, Nt as RenderedChunk, O as RolldownPluginOption, P as ExistingRawSourceMap, Pt as RenderedModule, Q as RolldownDirectoryEntry, R as TransformPluginContext, Rt as ModuleInfo, S as PartialResolvedId, St as GeneratedCodePreset, T as ResolveIdResult, Tt as ModuleFormat, U as PluginContext, V as EmittedPrebuiltChunk, W as DefineParallelPluginResult, X as ModuleTypeFilter, Y as HookFilter, Z as BufferEncoding, _ as LoadResult, _t as AdvancedChunksGroup, a as ExternalOption, at as ChecksOptions, b as ObjectHook, bt as CodeSplittingGroup, c as InputOptions, ct as watch, d as WatcherOptions, dt as WatchOptions, et as RolldownFsModule, f as AsyncPluginHooks, ft as rolldown, g as ImportKind, gt as AddonFunction, h as HookFilterExtension, ht as build, i as RolldownOptions, it as TransformOptions, jt as OutputAsset, k as SourceDescription, kt as PartialNull, l as ModuleTypes, lt as RolldownWatcher, m as FunctionPluginHooks, mt as BuildOptions, n as RolldownOptionsFunction, nt as NormalizedOutputOptions, o as ExternalOptionFunction, ot as LoggingFunction, p as CustomPluginOptions, pt as RolldownBuild, q as PluginContextMeta, r as defineConfig, rt as NormalizedInputOptions, s as InputOption, st as WarningHandlerWithDefault, t as ConfigExport, tt as InternalModuleFormat, u as OptimizationOptions, ut as RolldownWatcherEvent, v as ModuleOptions, vt as ChunkFileNamesFunction, w as ResolveIdExtraOptions, wt as MinifyOptions, x as ParallelPluginHooks, xt as GeneratedCodeOptions, y as ModuleType, yt as ChunkingContext, z as EmittedAsset, zt as SourcemapIgnoreListOption } from "./shared/define-config-glNgjHCc.mjs";
4
- export { AddonFunction, AdvancedChunksGroup, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, ChecksOptions, ChunkFileNamesFunction, ChunkingContext, CodeSplittingGroup, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, EmittedPrebuiltChunk, ExistingRawSourceMap, ExternalOption, ExternalOptionFunction, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformOptions, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
1
+ import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-wIy4zY9I.mjs";
2
+ import { P as PreRenderedChunk, s as BindingMagicString } from "./shared/binding-B92Lq__Q.mjs";
3
+ import { $ as BufferEncoding, A as TransformResult, At as MinifyOptions, B as EmittedChunk, Bt as RenderedModule, C as Plugin, Ct as ChunkingContext, D as RolldownPlugin, Dt as GeneratedCodeOptions, E as ResolvedId, Et as CodeSplittingOptions, F as SourceMapInput, Ft as PartialNull, G as PluginContextResolveOptions, Gt as SourcemapIgnoreListOption, H as EmittedPrebuiltChunk, Ht as SourceMap, I as OutputBundle, J as MinimalPluginContext, K as DefineParallelPluginResult, L as TreeshakingOptions, Lt as OutputAsset, Mt as OutputOptions, N as VERSION, Nt as PreRenderedAsset, O as RolldownPluginOption, Ot as GeneratedCodePreset, P as ExistingRawSourceMap, Q as ModuleTypeFilter, R as TransformPluginContext, Rt as OutputChunk, S as PartialResolvedId, St as ChunkFileNamesFunction, T as ResolveIdResult, Tt as CodeSplittingNameFunction, U as GetModuleInfo, V as EmittedFile, Vt as RolldownOutput, W as PluginContext, Wt as ModuleInfo, X as GeneralHookFilter, Y as PluginContextMeta, Z as HookFilter, _ as LoadResult, _t as BuildOptions, a as ExternalOption, at as NormalizedInputOptions, b as ObjectHook, bt as AdvancedChunksGroup, c as InputOptions, ct as LoggingFunction, d as WatcherOptions, dt as RolldownWatcher, et as RolldownDirectoryEntry, f as AsyncPluginHooks, ft as RolldownWatcherEvent, g as ImportKind, gt as RolldownBuild, h as HookFilterExtension, ht as rolldown, i as RolldownOptions, it as NormalizedOutputOptions, jt as ModuleFormat, k as SourceDescription, kt as GlobalsFunction, l as ModuleTypes, lt as WarningHandlerWithDefault, m as FunctionPluginHooks, mt as WatchOptions, n as RolldownOptionsFunction, nt as RolldownFsModule, o as ExternalOptionFunction, ot as TransformOptions, p as CustomPluginOptions, pt as RolldownWatcherWatcherEventMap, r as defineConfig, rt as InternalModuleFormat, s as InputOption, st as ChecksOptions, t as ConfigExport, tt as RolldownFileStats, u as OptimizationOptions, ut as watch, v as ModuleOptions, vt as build, w as ResolveIdExtraOptions, wt as CodeSplittingGroup, x as ParallelPluginHooks, xt as AdvancedChunksOptions, y as ModuleType, yt as AddonFunction, z as EmittedAsset, zt as RenderedChunk } from "./shared/define-config-D8xP5iyL.mjs";
4
+ export { AddonFunction, AdvancedChunksGroup, AdvancedChunksOptions, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, ChecksOptions, ChunkFileNamesFunction, ChunkingContext, CodeSplittingGroup, CodeSplittingNameFunction, CodeSplittingOptions, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedChunk, EmittedFile, EmittedPrebuiltChunk, ExistingRawSourceMap, ExternalOption, ExternalOptionFunction, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PluginContextResolveOptions, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownError, RolldownError as RollupError, RolldownFileStats, RolldownFsModule, RolldownLog, RolldownLog as RollupLog, RolldownLogWithString, RolldownLogWithString as RollupLogWithString, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RolldownWatcherWatcherEventMap, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformOptions, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-uOeDeDzp.mjs";
2
- import { n as onExit, t as watch } from "./shared/watch-Ce8bKBAn.mjs";
3
- import "./shared/normalize-string-or-regex-0f6WITto.mjs";
4
- import { S as VERSION } from "./shared/bindingify-input-options-CuBDHglZ.mjs";
5
- import "./shared/rolldown-build-BqHWBpp7.mjs";
6
- import "./shared/parse-ast-index-B0iVLbj6.mjs";
7
- import { t as rolldown } from "./shared/rolldown-mAJGca5O.mjs";
8
- import { t as defineConfig } from "./shared/define-config-BF4P-Pum.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-tNJoEqAa.mjs";
2
+ import { n as onExit, t as watch } from "./shared/watch-HmN4U4B9.mjs";
3
+ import "./shared/normalize-string-or-regex-DeB7vQ75.mjs";
4
+ import { S as VERSION } from "./shared/bindingify-input-options-CfhrNd_y.mjs";
5
+ import "./shared/rolldown-build-DWeKtJOy.mjs";
6
+ import "./shared/parse-ast-index-BcP4Ts_P.mjs";
7
+ import { t as rolldown } from "./shared/rolldown-BMzJcmQ7.mjs";
8
+ import { t as defineConfig } from "./shared/define-config-BVG4QvnP.mjs";
9
9
  import { isMainThread } from "node:worker_threads";
10
10
 
11
11
  //#region src/setup.ts
@@ -19,6 +19,25 @@ if (isMainThread) {
19
19
 
20
20
  //#endregion
21
21
  //#region src/api/build.ts
22
+ /**
23
+ * The API similar to esbuild's `build` function.
24
+ *
25
+ * @example
26
+ * ```js
27
+ * import { build } from 'rolldown';
28
+ *
29
+ * const result = await build({
30
+ * input: 'src/main.js',
31
+ * output: {
32
+ * file: 'bundle.js',
33
+ * },
34
+ * });
35
+ * console.log(result);
36
+ * ```
37
+ *
38
+ * @experimental
39
+ * @category Programmatic APIs
40
+ */
22
41
  async function build(options) {
23
42
  if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
24
43
  else {
@@ -1,7 +1,7 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-uOeDeDzp.mjs";
2
- import "./shared/normalize-string-or-regex-0f6WITto.mjs";
3
- import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-CuBDHglZ.mjs";
4
- import "./shared/parse-ast-index-B0iVLbj6.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-tNJoEqAa.mjs";
2
+ import "./shared/normalize-string-or-regex-DeB7vQ75.mjs";
3
+ import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-CfhrNd_y.mjs";
4
+ import "./shared/parse-ast-index-BcP4Ts_P.mjs";
5
5
  import { parentPort, workerData } from "node:worker_threads";
6
6
 
7
7
  //#region src/parallel-plugin-worker.ts
@@ -1,12 +1,12 @@
1
- import "./shared/binding-C9YdqoUG.mjs";
2
- import { C as Plugin, Ot as MaybePromise } from "./shared/define-config-glNgjHCc.mjs";
1
+ import "./shared/binding-B92Lq__Q.mjs";
2
+ import { C as Plugin, Pt as MaybePromise } from "./shared/define-config-D8xP5iyL.mjs";
3
3
 
4
4
  //#region src/plugin/parallel-plugin-implementation.d.ts
5
5
  type ParallelPluginImplementation = Plugin;
6
6
  type Context = {
7
7
  /**
8
- * Thread number
9
- */
8
+ * Thread number
9
+ */
10
10
  threadNumber: number;
11
11
  };
12
12
  declare function defineParallelPluginImplementation<Options>(plugin: (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>): (Options: Options, context: Context) => MaybePromise<ParallelPluginImplementation>;
@@ -1,4 +1,4 @@
1
- import { M as ParseResult, N as ParserOptions } from "./shared/binding-C9YdqoUG.mjs";
1
+ import { M as ParseResult, N as ParserOptions } from "./shared/binding-B92Lq__Q.mjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
 
4
4
  //#region src/parse-ast-index.d.ts
@@ -1,4 +1,4 @@
1
- import "./shared/binding-uOeDeDzp.mjs";
2
- import { n as parseAstAsync, t as parseAst } from "./shared/parse-ast-index-B0iVLbj6.mjs";
1
+ import "./shared/binding-tNJoEqAa.mjs";
2
+ import { n as parseAstAsync, t as parseAst } from "./shared/parse-ast-index-BcP4Ts_P.mjs";
3
3
 
4
4
  export { parseAst, parseAstAsync };
@@ -1,9 +1,8 @@
1
- import { u as BindingReplacePluginConfig } from "./shared/binding-C9YdqoUG.mjs";
2
- import { M as BuiltinPlugin } from "./shared/define-config-glNgjHCc.mjs";
3
- import { t as esmExternalRequirePlugin } from "./shared/constructors-D9F4Aj4h.mjs";
1
+ import { d as BindingReplacePluginConfig } from "./shared/binding-B92Lq__Q.mjs";
2
+ import { M as BuiltinPlugin } from "./shared/define-config-D8xP5iyL.mjs";
3
+ import { t as esmExternalRequirePlugin } from "./shared/constructors--k1uxZrh.mjs";
4
4
 
5
5
  //#region src/builtin-plugin/replace-plugin.d.ts
6
-
7
6
  /**
8
7
  * Replaces targeted strings in files while bundling.
9
8
  *
@@ -1,6 +1,6 @@
1
- import "./shared/binding-uOeDeDzp.mjs";
2
- import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-0f6WITto.mjs";
3
- import { t as esmExternalRequirePlugin } from "./shared/constructors-DmSv3tnW.mjs";
1
+ import "./shared/binding-tNJoEqAa.mjs";
2
+ import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-DeB7vQ75.mjs";
3
+ import { t as esmExternalRequirePlugin } from "./shared/constructors-414MPkgB.mjs";
4
4
 
5
5
  //#region src/builtin-plugin/replace-plugin.ts
6
6
  /**