rolldown 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/THIRD-PARTY-LICENSE +33 -0
  2. package/dist/cli.d.mts +1 -1
  3. package/dist/cli.mjs +9 -10
  4. package/dist/config.d.mts +1 -1
  5. package/dist/config.mjs +2 -2
  6. package/dist/experimental-default-runtime.mjs +116 -0
  7. package/dist/experimental-index.d.mts +10 -4
  8. package/dist/experimental-index.mjs +32 -16
  9. package/dist/experimental-runtime-base.mjs +95 -0
  10. package/dist/experimental-runtime.d.ts +177 -0
  11. package/dist/experimental-runtime.mjs +257 -0
  12. package/dist/filter-index.d.mts +1 -1
  13. package/dist/filter-index.mjs +1 -3
  14. package/dist/index.d.mts +3 -3
  15. package/dist/index.mjs +4 -4
  16. package/dist/parallel-plugin-worker.d.mts +1 -1
  17. package/dist/parallel-plugin-worker.mjs +3 -3
  18. package/dist/parallel-plugin.d.mts +1 -1
  19. package/dist/parse-ast-index.d.mts +1 -1
  20. package/dist/parse-ast-index.mjs +2 -2
  21. package/dist/plugins-index.d.mts +3 -3
  22. package/dist/plugins-index.mjs +2 -2
  23. package/dist/shared/{binding-Dbbi0RbO.d.mts → binding-CVtkJvyl.d.mts} +11 -0
  24. package/dist/shared/{binding-Dby9rwGk.mjs → binding-DwUQWZOo.mjs} +124 -50
  25. package/dist/shared/{bindingify-input-options-_ppP73I9.mjs → bindingify-input-options-BHixd47T.mjs} +448 -268
  26. package/dist/shared/{constructors-CSWbNgBZ.d.mts → constructors-ALilxAii.d.mts} +2 -2
  27. package/dist/shared/{constructors-CuGa75s-.mjs → constructors-COwFYQna.mjs} +10 -6
  28. package/dist/shared/{rolldown-build-CdF8HAHX.mjs → create-bundler-option-LuUKlAT7.mjs} +72 -179
  29. package/dist/shared/{define-config-B-IDOhDz.d.mts → define-config-DSMNXceb.d.mts} +85 -22
  30. package/dist/shared/{error-DFGNOCle.mjs → error-nLggAzpQ.mjs} +1 -1
  31. package/dist/shared/{load-config-C6UyiS41.mjs → load-config-cRWJAHTc.mjs} +2 -2
  32. package/dist/shared/{logs-ZGEh6uhb.mjs → logs-DmYCAKcW.mjs} +8 -1
  33. package/dist/shared/{misc-CoQm4NHO.mjs → misc-DOSKtd97.mjs} +9 -1
  34. package/dist/shared/{normalize-string-or-regex-SiXbePVH.mjs → normalize-string-or-regex-Cj-DgIV1.mjs} +2 -2
  35. package/dist/shared/{parse-BFj5G_7i.mjs → parse-C17W7W5g.mjs} +2 -2
  36. package/dist/shared/{prompt--dNycKSZ.mjs → prompt-CH6TK0bC.mjs} +2 -6
  37. package/dist/shared/{resolve-tsconfig-2TXRF_zr.mjs → resolve-tsconfig-CE3HNSOK.mjs} +2 -2
  38. package/dist/shared/rolldown-D23fYgSS.mjs +178 -0
  39. package/dist/shared/{transform-Cs2bUDRH.d.mts → transform-WmU_cI8e.d.mts} +1 -1
  40. package/dist/shared/{watch-WnrlHRS0.mjs → watch-DcgK_L55.mjs} +16 -13
  41. package/dist/utils-index.d.mts +3 -3
  42. package/dist/utils-index.mjs +6 -8
  43. package/package.json +32 -25
  44. package/dist/shared/rolldown-951h_1lf.mjs +0 -40
@@ -0,0 +1,257 @@
1
+ import { __exportAll, __reExport, __toCommonJS, __toESM } from './experimental-runtime-base.mjs';
2
+ // @ts-check
3
+
4
+ class Module {
5
+ /**
6
+ * @type {{ exports: any }}
7
+ */
8
+ exportsHolder = { exports: null };
9
+ /**
10
+ * @type {string}
11
+ */
12
+ id;
13
+
14
+ /**
15
+ * @param {string} id
16
+ */
17
+ constructor(id) {
18
+ this.id = id;
19
+ }
20
+
21
+ get exports() {
22
+ return this.exportsHolder.exports;
23
+ }
24
+ }
25
+
26
+ /**
27
+ * Compiler-emitted module-graph delta — pure topology (static + dynamic edges).
28
+ * `ids[0, localCount)` are the modules this payload carries; `ids[localCount, …)` are foreign edge targets.
29
+ * `edges[i]` / `dynamicEdges[i]` are the static / dynamic-`import()` out-edges of `ids[i]`.
30
+ * @typedef {{ ids: string[], localCount: number, edges: number[][], dynamicEdges?: number[][] }} ModuleGraphDelta
31
+ * @typedef {{ createModuleHotContext(moduleId: string): any, onModuleCacheRemoval(moduleId: string): void }} DevRuntimeHooks
32
+ */
33
+
34
+ export class MissingFactoryError extends Error {
35
+ /**
36
+ * @param {string} id
37
+ */
38
+ constructor(id) {
39
+ super(`No factory registered for module ${id}`);
40
+ this.id = id;
41
+ }
42
+ }
43
+
44
+ export class DevRuntime {
45
+ /**
46
+ * Client ID generated at runtime initialization, used for lazy compilation requests.
47
+ * @type {string}
48
+ */
49
+ clientId;
50
+
51
+ /**
52
+ * @param {string} clientId
53
+ */
54
+ constructor(clientId) {
55
+ this.clientId = clientId;
56
+ }
57
+
58
+ /**
59
+ * Static import edges from `registerGraph` — entries persist across `removeModuleCache`
60
+ * and change only by replacement from a newer payload (last write wins).
61
+ * @type {Map<string, { edges: string[] }>}
62
+ */
63
+ staticImports = new Map();
64
+ /**
65
+ * Reverse index over the static imports.
66
+ * @type {Map<string, Set<string>>}
67
+ */
68
+ importers = new Map();
69
+ /**
70
+ * Dynamic `import()` edges from `registerGraph`, keyed by importer — mirror of
71
+ * `staticImports` for the dynamic reverse index.
72
+ * @type {Map<string, { edges: string[] }>}
73
+ */
74
+ dynamicImports = new Map();
75
+ /**
76
+ * Reverse index over the dynamic imports.
77
+ * @type {Map<string, Set<string>>}
78
+ */
79
+ dynamicImporters = new Map();
80
+ /**
81
+ * The module cache. Membership means "this module's side effects ran in this tab" —
82
+ * registration is emitted ahead of every module body, and nothing un-registers on
83
+ * unwind, so a factory that throws mid-body stays registered. A `Map` rather than a
84
+ * plain object: HMR eviction deletes entries, and a `delete` on an object drops V8
85
+ * into dictionary mode, taxing every later lookup on the hottest read path.
86
+ * @type {Map<string, Module>}
87
+ */
88
+ moduleCache = new Map();
89
+ /**
90
+ * Re-runnable factories from HMR patches and lazy chunks. The initial bundle stays
91
+ * scope-hoisted and contributes none.
92
+ * @type {Map<string, { kind: 'esm' | 'cjs', fn: (id: string) => void }>}
93
+ */
94
+ factories = new Map();
95
+ /**
96
+ * Installed by the dev client at boot. The runtime is a store + executor and makes
97
+ * no HMR decisions; accepting, disposing, and reloading live behind these hooks.
98
+ * @type {DevRuntimeHooks | null}
99
+ */
100
+ hooks = null;
101
+
102
+ /**
103
+ * @param {ModuleGraphDelta} delta
104
+ */
105
+ registerGraph(delta) {
106
+ for (let i = 0; i < delta.localCount; i++) {
107
+ const id = delta.ids[i];
108
+ const edges = delta.edges[i].map((j) => delta.ids[j]);
109
+ for (const target of this.staticImports.get(id)?.edges ?? []) {
110
+ this.importers.get(target)?.delete(id);
111
+ }
112
+ for (const target of edges) {
113
+ let importerSet = this.importers.get(target);
114
+ if (!importerSet) {
115
+ importerSet = new Set();
116
+ this.importers.set(target, importerSet);
117
+ }
118
+ importerSet.add(id);
119
+ }
120
+ this.staticImports.set(id, { edges });
121
+
122
+ // Dynamic `import()` edges are maintained in a parallel reverse index with the same
123
+ // last-write-wins bookkeeping; `getImporters` unions the two.
124
+ const dynamicEdges = (delta.dynamicEdges?.[i] ?? []).map((j) => delta.ids[j]);
125
+ for (const target of this.dynamicImports.get(id)?.edges ?? []) {
126
+ this.dynamicImporters.get(target)?.delete(id);
127
+ }
128
+ for (const target of dynamicEdges) {
129
+ let importerSet = this.dynamicImporters.get(target);
130
+ if (!importerSet) {
131
+ importerSet = new Set();
132
+ this.dynamicImporters.set(target, importerSet);
133
+ }
134
+ importerSet.add(id);
135
+ }
136
+ this.dynamicImports.set(id, { edges: dynamicEdges });
137
+ }
138
+ }
139
+
140
+ /**
141
+ * @param {string} id
142
+ * @param {'esm' | 'cjs'} kind
143
+ * @param {(id: string) => void} fn
144
+ */
145
+ registerFactory(id, kind, fn) {
146
+ this.factories.set(id, { kind, fn });
147
+ }
148
+
149
+ /**
150
+ * @param {string} id
151
+ * @param {{ exports: any }} exportsHolder
152
+ */
153
+ registerModule(id, exportsHolder) {
154
+ const module = new Module(id);
155
+ module.exportsHolder = exportsHolder;
156
+ this.moduleCache.set(id, module);
157
+ }
158
+
159
+ /**
160
+ * @param {string} id
161
+ * @returns {string[]}
162
+ */
163
+ getImporters(id) {
164
+ // Static ∪ dynamic importers — the boundary walk treats both kinds the same (parity
165
+ // with Vite `node.importers` / webpack `module.parents`). Deduped so a module that
166
+ // imports `id` both statically and via `import()` appears once.
167
+ const dynamic = this.dynamicImporters.get(id);
168
+ if (!dynamic || dynamic.size === 0) {
169
+ return [...(this.importers.get(id) ?? [])];
170
+ }
171
+ return [...new Set([...(this.importers.get(id) ?? []), ...dynamic])];
172
+ }
173
+
174
+ /**
175
+ * @param {string} id
176
+ */
177
+ isExecuted(id) {
178
+ return this.moduleCache.has(id);
179
+ }
180
+
181
+ /**
182
+ * @param {string} id
183
+ */
184
+ hasFactory(id) {
185
+ return this.factories.has(id);
186
+ }
187
+
188
+ /**
189
+ * Module-cache delete only — static imports and factories persist. Removal is what
190
+ * re-arms a cache-gated factory for `initModule`.
191
+ * @param {string} id
192
+ */
193
+ removeModuleCache(id) {
194
+ this.moduleCache.delete(id);
195
+ this.hooks?.onModuleCacheRemoval(id);
196
+ }
197
+
198
+ /**
199
+ * The one re-execution gate: registered → return the live exports; otherwise run the
200
+ * mapped factory (which registers itself first, then runs the body).
201
+ * @param {string} id
202
+ */
203
+ initModule(id) {
204
+ if (this.moduleCache.has(id)) {
205
+ return this.loadExports(id);
206
+ }
207
+ const factory = this.factories.get(id);
208
+ if (!factory) {
209
+ throw new MissingFactoryError(id);
210
+ }
211
+ factory.fn(id);
212
+ return this.loadExports(id);
213
+ }
214
+
215
+ /**
216
+ * @param {string} id
217
+ */
218
+ loadExports(id) {
219
+ const module = this.moduleCache.get(id);
220
+ if (module) {
221
+ return module.exportsHolder.exports;
222
+ } else {
223
+ console.warn(`Module ${id} not found`);
224
+ return {};
225
+ }
226
+ }
227
+
228
+ /**
229
+ * @param {string} moduleId
230
+ */
231
+ createModuleHotContext(moduleId) {
232
+ if (this.hooks) {
233
+ return this.hooks.createModuleHotContext(moduleId);
234
+ }
235
+ throw new Error('createModuleHotContext requires installed hooks or an override');
236
+ }
237
+
238
+ /** @internal */
239
+ // @ts-expect-error The variable will be injected at build time.
240
+ __toESM = __toESM;
241
+ /** @internal */
242
+ // @ts-expect-error The variable will be injected at build time.
243
+ __toCommonJS = __toCommonJS;
244
+ /** @internal */
245
+ // @ts-expect-error The variable will be injected at build time.
246
+ __exportAll = __exportAll;
247
+ /**
248
+ * @param {boolean} [isNodeMode]
249
+ * @returns {(mod: any) => any}
250
+ * @internal
251
+ */
252
+ // @ts-expect-error The variable will be injected at build time.
253
+ __toDynamicImportESM = (isNodeMode) => (mod) => __toESM(mod.default, isNodeMode);
254
+ /** @internal */
255
+ // @ts-expect-error The variable will be injected at build time.
256
+ __reExport = __reExport;
257
+ }
@@ -1,4 +1,4 @@
1
- import { P as withFilter } from "./shared/define-config-B-IDOhDz.mjs";
1
+ import { F as withFilter } from "./shared/define-config-DSMNXceb.mjs";
2
2
  //#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.1/node_modules/@rolldown/pluginutils/dist/filter/index.d.mts
3
3
  //#region src/filter/composable-filters.d.ts
4
4
  type StringOrRegExp = string | RegExp;
@@ -1,4 +1,4 @@
1
- import { n as isPromiseLike, t as arraify } from "./shared/misc-CoQm4NHO.mjs";
1
+ import { r as isPromiseLike, t as arraify } from "./shared/misc-DOSKtd97.mjs";
2
2
  //#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.1/node_modules/@rolldown/pluginutils/dist/filter-B_mD-HGz.mjs
3
3
  const postfixRE = /[?#].*$/;
4
4
  function cleanUrl(url) {
@@ -335,8 +335,6 @@ function withFilterImpl(pluginOption, filterObjectList) {
335
335
  handler: plugin[key],
336
336
  filter: filterObject[key]
337
337
  };
338
- break;
339
- default: break;
340
338
  }
341
339
  });
342
340
  return plugin;
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-xuHO4mAy.mjs";
2
- import { B as PreRenderedChunk } from "./shared/binding-Dbbi0RbO.mjs";
3
- import { $ as MinimalPluginContext, $t as SourcemapIgnoreListOption, A as RolldownPlugin, At as ChunkingContext, B as SourceMapInput, Bt as OutputOptions, C as ParallelPluginHooks, Ct as BuildOptions, D as ResolveIdExtraOptions, Dt as AdvancedChunksOptions, E as PluginMeta, Et as AdvancedChunksGroup, Ft as GeneratedCodeOptions, G as EmittedChunk, Gt as OutputAsset, H as TreeshakingOptions, I as RUNTIME_MODULE_ID, It as GeneratedCodePreset, J as GetModuleInfo, Jt as RenderedModule, K as EmittedFile, Kt as OutputChunk, L as VERSION, Lt as GlobalsFunction, M as SourceDescription, Mt as CodeSplittingNameFunction, N as TransformResult, Nt as CodeSplittingOptions, O as ResolveIdResult, Ot as BuiltinModuleTag, Pt as CommentsOptions, Qt as ModuleInfo, R as BundleError, Rt as MinifyOptions, S as ObjectHook, St as RolldownBuild, T as Plugin, Tt as AddonFunction, U as TransformPluginContext, Ut as PartialNull, V as OutputBundle, Vt as PreRenderedAsset, W as EmittedAsset, X as PluginContextResolveOptions, Xt as SourceMap, Y as PluginContext, Yt as RolldownOutput, Z as DefineParallelPluginResult, _ as HookFilterExtension, _t as RolldownWatcher, a as ChunkOptimizationOptions, at as RolldownDirectoryEntry, b as ModuleOptions, bt as WatchOptions, c as InputOption, ct as InternalModuleFormat, d as OptimizationOptions, dt as TransformOptions, et as PluginContextMeta, f as WatcherFileWatcherOptions, ft as ChecksOptions, g as FunctionPluginHooks, gt as watch, h as CustomPluginOptions, ht as RolldownMagicString, i as RolldownOptions, it as BufferEncoding, j as RolldownPluginOption, jt as CodeSplittingGroup, k as ResolvedId, kt as ChunkFileNamesFunction, l as InputOptions, lt as NormalizedOutputOptions, m as AsyncPluginHooks, mt as WarningHandlerWithDefault, n as RolldownOptionsFunction, nt as HookFilter, o as ExternalOption, ot as RolldownFileStats, p as WatcherOptions, pt as LoggingFunction, q as EmittedPrebuiltChunk, qt as RenderedChunk, r as defineConfig, rt as ModuleTypeFilter, s as ExternalOptionFunction, st as RolldownFsModule, t as ConfigExport, tt as GeneralHookFilter, u as ModuleTypes, ut as NormalizedInputOptions, v as ImportKind, vt as RolldownWatcherEvent, w as PartialResolvedId, wt as build, x as ModuleType, xt as rolldown, y as LoadResult, yt as RolldownWatcherWatcherEventMap, z as ExistingRawSourceMap, zt as ModuleFormat } from "./shared/define-config-B-IDOhDz.mjs";
4
- export { type AddonFunction, type AdvancedChunksGroup, type AdvancedChunksOptions, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, type BuiltinModuleTag, type BundleError, type ChecksOptions, type ChunkFileNamesFunction, type ChunkOptimizationOptions, type ChunkingContext, type CodeSplittingGroup, type CodeSplittingNameFunction, type CodeSplittingOptions, type CommentsOptions, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedChunk, type EmittedFile, type EmittedPrebuiltChunk, type ExistingRawSourceMap, type ExternalOption, type ExternalOptionFunction, type FunctionPluginHooks, type GeneralHookFilter, type GeneratedCodeOptions, type GeneratedCodePreset, 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, 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 PluginContextResolveOptions, type PluginMeta, type PreRenderedAsset, type PreRenderedChunk, RUNTIME_MODULE_ID, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownError, type RolldownError as RollupError, type RolldownFileStats, type RolldownFsModule, type RolldownLog, type RolldownLog as RollupLog, type RolldownLogWithString, type RolldownLogWithString as RollupLogWithString, RolldownMagicString, type RolldownOptions, type RolldownOptionsFunction, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RolldownWatcherWatcherEventMap, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformOptions, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherFileWatcherOptions, type WatcherOptions, build, defineConfig, rolldown, watch };
2
+ import { B as PreRenderedChunk } from "./shared/binding-CVtkJvyl.mjs";
3
+ import { $t as ModuleInfo, A as ResolvedId, At as ChunkFileNamesFunction, B as ExistingRawSourceMap, Bt as ModuleFormat, C as ParallelPluginHooks, Ct as RolldownBuild, D as ResolveFileUrlArgs, Dt as AdvancedChunksGroup, E as PluginMeta, Et as AddonFunction, Ft as CommentsOptions, G as EmittedAsset, H as OutputBundle, Ht as PreRenderedAsset, It as GeneratedCodeOptions, J as EmittedPrebuiltChunk, Jt as RenderedChunk, K as EmittedChunk, Kt as OutputAsset, L as RUNTIME_MODULE_ID, Lt as GeneratedCodePreset, M as RolldownPluginOption, Mt as CodeSplittingGroup, N as SourceDescription, Nt as CodeSplittingNameFunction, O as ResolveIdExtraOptions, Ot as AdvancedChunksOptions, P as TransformResult, Pt as CodeSplittingOptions, Q as DefineParallelPluginResult, R as VERSION, Rt as GlobalsFunction, S as ObjectHook, St as rolldown, T as Plugin, Tt as build, U as TreeshakingOptions, V as SourceMapInput, Vt as OutputOptions, W as TransformPluginContext, Wt as PartialNull, X as PluginContext, Xt as RolldownOutput, Y as GetModuleInfo, Yt as RenderedModule, Z as PluginContextResolveOptions, Zt as SourceMap, _ as HookFilterExtension, _t as watch, a as ChunkOptimizationOptions, at as BufferEncoding, b as ModuleOptions, bt as RolldownWatcherWatcherEventMap, c as InputOption, ct as RolldownFsModule, d as OptimizationOptions, dt as NormalizedInputOptions, en as SourcemapIgnoreListOption, et as MinimalPluginContext, f as WatcherFileWatcherOptions, ft as TransformOptions, g as FunctionPluginHooks, gt as RolldownMagicString, h as CustomPluginOptions, ht as WarningHandlerWithDefault, i as RolldownOptions, it as ModuleTypeFilter, j as RolldownPlugin, jt as ChunkingContext, k as ResolveIdResult, kt as BuiltinModuleTag, l as InputOptions, lt as InternalModuleFormat, m as AsyncPluginHooks, mt as LoggingFunction, n as RolldownOptionsFunction, nt as GeneralHookFilter, o as ExternalOption, ot as RolldownDirectoryEntry, p as WatcherOptions, pt as ChecksOptions, q as EmittedFile, qt as OutputChunk, r as defineConfig, rt as HookFilter, s as ExternalOptionFunction, st as RolldownFileStats, t as ConfigExport, tt as PluginContextMeta, u as ModuleTypes, ut as NormalizedOutputOptions, v as ImportKind, vt as RolldownWatcher, w as PartialResolvedId, wt as BuildOptions, x as ModuleType, xt as WatchOptions, y as LoadResult, yt as RolldownWatcherEvent, z as BundleError, zt as MinifyOptions } from "./shared/define-config-DSMNXceb.mjs";
4
+ export { type AddonFunction, type AdvancedChunksGroup, type AdvancedChunksOptions, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, type BuiltinModuleTag, type BundleError, type ChecksOptions, type ChunkFileNamesFunction, type ChunkOptimizationOptions, type ChunkingContext, type CodeSplittingGroup, type CodeSplittingNameFunction, type CodeSplittingOptions, type CommentsOptions, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedChunk, type EmittedFile, type EmittedPrebuiltChunk, type ExistingRawSourceMap, type ExternalOption, type ExternalOptionFunction, type FunctionPluginHooks, type GeneralHookFilter, type GeneratedCodeOptions, type GeneratedCodePreset, 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, 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 PluginContextResolveOptions, type PluginMeta, type PreRenderedAsset, type PreRenderedChunk, RUNTIME_MODULE_ID, type RenderedChunk, type RenderedModule, type ResolveFileUrlArgs, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownError, type RolldownError as RollupError, type RolldownFileStats, type RolldownFsModule, type RolldownLog, type RolldownLog as RollupLog, type RolldownLogWithString, type RolldownLogWithString as RollupLogWithString, RolldownMagicString, type RolldownOptions, type RolldownOptionsFunction, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RolldownWatcherWatcherEventMap, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformOptions, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherFileWatcherOptions, type WatcherOptions, build, defineConfig, rolldown, watch };
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-Dby9rwGk.mjs";
2
- import { n as onExit, t as watch } from "./shared/watch-WnrlHRS0.mjs";
3
- import { b as VERSION, r as RolldownMagicString } from "./shared/bindingify-input-options-_ppP73I9.mjs";
4
- import { t as rolldown } from "./shared/rolldown-951h_1lf.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-DwUQWZOo.mjs";
2
+ import { n as onExit, t as watch } from "./shared/watch-DcgK_L55.mjs";
3
+ import { T as VERSION, s as RolldownMagicString } from "./shared/bindingify-input-options-BHixd47T.mjs";
4
+ import { t as rolldown } from "./shared/rolldown-D23fYgSS.mjs";
5
5
  import { t as defineConfig } from "./shared/define-config-Demdg3_4.mjs";
6
6
  import { isMainThread } from "node:worker_threads";
7
7
  //#region src/setup.ts
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1,5 +1,5 @@
1
- import { n as __toESM, t as require_binding } from "./shared/binding-Dby9rwGk.mjs";
2
- import { i as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-_ppP73I9.mjs";
1
+ import { n as __toESM, t as require_binding } from "./shared/binding-DwUQWZOo.mjs";
2
+ import { c as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-BHixd47T.mjs";
3
3
  import { parentPort, workerData } from "node:worker_threads";
4
4
  //#region src/parallel-plugin-worker.ts
5
5
  var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
@@ -11,7 +11,7 @@ const { registryId, pluginInfos, threadNumber } = workerData;
11
11
  const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
12
12
  return {
13
13
  index: pluginInfo.index,
14
- plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, [], []), [], () => {}, "info", false)
14
+ plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, [], []), [], () => {}, "info", false, void 0)
15
15
  };
16
16
  }));
17
17
  (0, import_binding.registerPlugins)(registryId, plugins);
@@ -1,4 +1,4 @@
1
- import { Ht as MaybePromise, T as Plugin } from "./shared/define-config-B-IDOhDz.mjs";
1
+ import { T as Plugin, Ut as MaybePromise } from "./shared/define-config-DSMNXceb.mjs";
2
2
  //#region src/plugin/parallel-plugin-implementation.d.ts
3
3
  type ParallelPluginImplementation = Plugin;
4
4
  type Context = {
@@ -1,4 +1,4 @@
1
- import { R as ParseResult$1, z as ParserOptions$1 } from "./shared/binding-Dbbi0RbO.mjs";
1
+ import { R as ParseResult$1, z as ParserOptions$1 } from "./shared/binding-CVtkJvyl.mjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
  //#region src/parse-ast-index.d.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
- import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./shared/logs-ZGEh6uhb.mjs";
2
- import { n as parseSync, t as parse } from "./shared/parse-BFj5G_7i.mjs";
1
+ import { c as logParseError, d as getCodeFrame, n as error, t as augmentCodeLocation, u as locate } from "./shared/logs-DmYCAKcW.mjs";
2
+ import { n as parseSync, t as parse } from "./shared/parse-C17W7W5g.mjs";
3
3
  //#region src/parse-ast-index.ts
4
4
  function wrap(result, filename, sourceText) {
5
5
  if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
@@ -1,6 +1,6 @@
1
- import { h as BindingReplacePluginConfig } from "./shared/binding-Dbbi0RbO.mjs";
2
- import { F as BuiltinPlugin } from "./shared/define-config-B-IDOhDz.mjs";
3
- import { t as esmExternalRequirePlugin } from "./shared/constructors-CSWbNgBZ.mjs";
1
+ import { h as BindingReplacePluginConfig } from "./shared/binding-CVtkJvyl.mjs";
2
+ import { I as BuiltinPlugin } from "./shared/define-config-DSMNXceb.mjs";
3
+ import { t as esmExternalRequirePlugin } from "./shared/constructors-ALilxAii.mjs";
4
4
  //#region src/builtin-plugin/replace-plugin.d.ts
5
5
  /**
6
6
  * Replaces targeted strings in files while bundling.
@@ -1,5 +1,5 @@
1
- import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-SiXbePVH.mjs";
2
- import { t as esmExternalRequirePlugin } from "./shared/constructors-CuGa75s-.mjs";
1
+ import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-Cj-DgIV1.mjs";
2
+ import { t as esmExternalRequirePlugin } from "./shared/constructors-COwFYQna.mjs";
3
3
  //#region src/builtin-plugin/replace-plugin.ts
4
4
  /**
5
5
  * Replaces targeted strings in files while bundling.
@@ -1712,6 +1712,13 @@ interface BindingIsolatedDeclarationPluginConfig {
1712
1712
  interface BindingLazyChunkOutput {
1713
1713
  code: string;
1714
1714
  filename: string;
1715
+ /**
1716
+ * The chunk's sourcemap, when `sourcemap` is `File` or `Hidden`. Serve it
1717
+ * under `sourcemapFilename`, which is what the chunk's `sourceMappingURL`
1718
+ * refers to.
1719
+ */
1720
+ sourcemap?: string;
1721
+ sourcemapFilename?: string;
1715
1722
  }
1716
1723
  interface BindingLogLocation {
1717
1724
  /** 1-based */
@@ -1732,6 +1739,8 @@ interface BindingModules {
1732
1739
  }
1733
1740
  interface BindingOverwriteOptions {
1734
1741
  contentOnly?: boolean;
1742
+ /** Stores the replaced content in the generated sourcemap's `names` field. */
1743
+ storeName?: boolean;
1735
1744
  }
1736
1745
  interface BindingPluginContextResolveOptions {
1737
1746
  /**
@@ -1834,6 +1843,8 @@ interface BindingTsconfigResult {
1834
1843
  }
1835
1844
  interface BindingUpdateOptions {
1836
1845
  overwrite?: boolean;
1846
+ /** Stores the replaced content in the generated sourcemap's `names` field. */
1847
+ storeName?: boolean;
1837
1848
  }
1838
1849
  interface BindingViteBuildImportAnalysisPluginConfig {
1839
1850
  preloadCode: string;