@rolldown/browser 1.0.0-beta.45 → 1.0.0-beta.47

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.
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { C as version, S as description, _ as getOutputCliKeys, g as getInputCliKeys, h as getCliSchemaInfo, i as watch, o as rolldown, v as validateCliOptions, w as onExit } from "./shared/src-B4ZmdjD5.mjs";
2
- import { h as styleText$1 } from "./shared/parse-ast-index-Ck5SwMSC.mjs";
1
+ import { C as version, S as description, _ as getOutputCliKeys, g as getInputCliKeys, h as getCliSchemaInfo, i as watch, o as rolldown, v as validateCliOptions, w as onExit } from "./shared/src-DE7RBSfl.mjs";
2
+ import { h as styleText$1 } from "./shared/parse-ast-index-BiBzSGZe.mjs";
3
3
  import { d as arraify } from "./shared/composable-filters-D_PY7Qa7.mjs";
4
- import { t as loadConfig } from "./shared/load-config-Z2MWPLZO.mjs";
4
+ import { t as loadConfig } from "./shared/load-config-D508WsWM.mjs";
5
5
  import { formatWithOptions, parseArgs } from "node:util";
6
6
  import path, { sep } from "node:path";
7
7
  import process$1 from "node:process";
@@ -1222,7 +1222,7 @@ function getClearScreenFunction(options$1) {
1222
1222
  }
1223
1223
 
1224
1224
  //#endregion
1225
- //#region \0@oxc-project+runtime@0.95.0/helpers/usingCtx.js
1225
+ //#region \0@oxc-project+runtime@0.96.0/helpers/usingCtx.js
1226
1226
  function _usingCtx() {
1227
1227
  var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$2, e$1) {
1228
1228
  var n$2 = Error();
package/dist/config.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { n as ConfigExport, t as defineConfig } from "./shared/define-config-C6-goOPh.mjs";
2
- import "./shared/binding-DRegrFdE.mjs";
1
+ import { n as ConfigExport, t as defineConfig } from "./shared/define-config-pfDd6Le4.mjs";
2
+ import "./shared/binding-CRSqCQIK.mjs";
3
3
 
4
4
  //#region src/utils/load-config.d.ts
5
5
  declare function loadConfig(configPath: string): Promise<ConfigExport>;
package/dist/config.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { C as version, r as defineConfig } from "./shared/src-B4ZmdjD5.mjs";
2
- import "./shared/parse-ast-index-Ck5SwMSC.mjs";
1
+ import { C as version, r as defineConfig } from "./shared/src-DE7RBSfl.mjs";
2
+ import "./shared/parse-ast-index-BiBzSGZe.mjs";
3
3
  import "./shared/composable-filters-D_PY7Qa7.mjs";
4
- import { t as loadConfig } from "./shared/load-config-Z2MWPLZO.mjs";
4
+ import { t as loadConfig } from "./shared/load-config-D508WsWM.mjs";
5
5
 
6
6
  //#region src/config.ts
7
7
  const VERSION = version;
@@ -1,5 +1,5 @@
1
- import { c as createBundlerOptions, d as transformToRollupOutput, f as bindingifySourcemap, h as makeBuiltinPluginCallable, l as normalizedStringOrRegex, m as BuiltinPlugin, p as PluginDriver, s as RolldownBuild, u as normalizeBindingResult } from "./src-CLWy1Uip.js";
2
- import { BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi-browser.js";
1
+ import { c as createBundlerOptions, d as transformToRollupOutput, f as bindingifySourcemap, h as makeBuiltinPluginCallable, l as normalizedStringOrRegex, m as BuiltinPlugin, p as PluginDriver, s as RolldownBuild, u as normalizeBindingResult } from "./src-Deywlnh0.js";
2
+ import { BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, minify, moduleRunnerTransform, transform } from "./rolldown-binding.wasi-browser.js";
3
3
 
4
4
  //#region src/api/dev/dev-engine.ts
5
5
  var DevEngine = class DevEngine {
@@ -83,6 +83,47 @@ var DevEngine = class DevEngine {
83
83
  //#region src/api/dev/index.ts
84
84
  const dev = (...args) => DevEngine.create(...args);
85
85
 
86
+ //#endregion
87
+ //#region src/types/external-memory-handle.ts
88
+ const symbolForExternalMemoryHandle = "__rolldown_external_memory_handle__";
89
+ /**
90
+ * Frees the external memory held by the given handle.
91
+ *
92
+ * This is useful when you want to manually release memory held by Rust objects
93
+ * (like `OutputChunk` or `OutputAsset`) before they are garbage collected.
94
+ *
95
+ * @param handle - The object with external memory to free
96
+ * @param keepDataAlive - If true, evaluates all lazy fields before freeing memory (default: false).
97
+ * This will take time to copy data from Rust to JavaScript, but prevents errors
98
+ * when accessing properties after the memory is freed.
99
+ * @returns Status object with `freed` boolean and optional `reason` string.
100
+ * - `{ freed: true }` if memory was successfully freed
101
+ * - `{ freed: false, reason: "..." }` if memory couldn't be freed (e.g., already freed or other references exist)
102
+ *
103
+ * @example
104
+ * ```typescript
105
+ * import { freeExternalMemory } from 'rolldown/experimental';
106
+ *
107
+ * const output = await bundle.generate();
108
+ * const chunk = output.output[0];
109
+ *
110
+ * // Use the chunk...
111
+ *
112
+ * // Manually free the memory (fast, but accessing properties after will throw)
113
+ * const status = freeExternalMemory(chunk); // { freed: true }
114
+ * const statusAgain = freeExternalMemory(chunk); // { freed: false, reason: "Memory has already been freed" }
115
+ *
116
+ * // Keep data alive before freeing (slower, but data remains accessible)
117
+ * freeExternalMemory(chunk, true); // Evaluates all lazy fields first
118
+ * console.log(chunk.code); // OK - data was copied to JavaScript before freeing
119
+ *
120
+ * // Without keepDataAlive, accessing chunk properties after freeing will throw an error
121
+ * ```
122
+ */
123
+ function freeExternalMemory(handle, keepDataAlive = false) {
124
+ return handle[symbolForExternalMemoryHandle](keepDataAlive);
125
+ }
126
+
86
127
  //#endregion
87
128
  //#region src/api/experimental.ts
88
129
  /**
@@ -208,10 +249,10 @@ function replacePlugin(values = {}, options = {}) {
208
249
  const value = values[key];
209
250
  if (typeof value !== "string") values[key] = String(value);
210
251
  });
211
- return new BuiltinPlugin("builtin:replace", {
252
+ return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:replace", {
212
253
  ...options,
213
254
  values
214
- });
255
+ }));
215
256
  }
216
257
 
217
258
  //#endregion
@@ -243,4 +284,4 @@ function viteCSSPlugin(config) {
243
284
  }
244
285
 
245
286
  //#endregion
246
- export { BindingRebuildStrategy, DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
287
+ export { BindingRebuildStrategy, DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, freeExternalMemory, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, minify, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
@@ -1,5 +1,5 @@
1
- import { A as BuiltinPlugin, N as SourceMapInput, U as defineParallelPlugin, bt as OutputOptions, kt as RolldownOutput, o as InputOptions, wt as StringOrRegExp } from "./shared/define-config-C6-goOPh.mjs";
2
- import { A as IsolatedDeclarationsResult, B as TransformResult, C as BindingViteCssPluginConfig, D as BindingWasmHelperPluginConfig, E as BindingViteResolvePluginConfig, H as moduleRunnerTransform, L as ResolveResult, N as NapiResolveOptions, R as ResolverFactory, S as BindingUrlResolver, T as BindingViteHtmlPluginConfig, U as transform, V as isolatedDeclaration, a as BindingClientHmrUpdate, d as BindingJsonPluginConfig, g as BindingRebuildStrategy, h as BindingReactRefreshWrapperPluginConfig, k as IsolatedDeclarationsOptions, l as BindingImportGlobPluginConfig, m as BindingModulePreloadPolyfillPluginConfig, n as BindingBuildImportAnalysisPluginConfig, o as BindingDynamicImportVarsPluginConfig, p as BindingManifestPluginConfig, s as BindingEsmExternalRequirePluginConfig, t as BindingAssetPluginConfig, u as BindingIsolatedDeclarationPluginConfig, v as BindingReplacePluginConfig, w as BindingViteCssPostPluginConfig, x as BindingTransformPluginConfig, y as BindingReporterPluginConfig, z as TransformOptions } from "./shared/binding-DRegrFdE.mjs";
1
+ import { A as BuiltinPlugin, N as SourceMapInput, U as defineParallelPlugin, bt as OutputOptions, jt as freeExternalMemory, kt as RolldownOutput, o as InputOptions, wt as StringOrRegExp } from "./shared/define-config-pfDd6Le4.mjs";
2
+ import { A as IsolatedDeclarationsOptions, B as ResolverFactory, C as BindingViteCssPluginConfig, D as BindingWasmHelperPluginConfig, E as BindingViteResolvePluginConfig, F as NapiResolveOptions, G as moduleRunnerTransform, H as TransformResult, K as transform, N as MinifyOptions, P as MinifyResult, S as BindingUrlResolver, T as BindingViteHtmlPluginConfig, U as isolatedDeclaration, V as TransformOptions, W as minify, a as BindingClientHmrUpdate, d as BindingJsonPluginConfig, g as BindingRebuildStrategy, h as BindingReactRefreshWrapperPluginConfig, j as IsolatedDeclarationsResult, l as BindingImportGlobPluginConfig, m as BindingModulePreloadPolyfillPluginConfig, n as BindingBuildImportAnalysisPluginConfig, o as BindingDynamicImportVarsPluginConfig, p as BindingManifestPluginConfig, s as BindingEsmExternalRequirePluginConfig, t as BindingAssetPluginConfig, u as BindingIsolatedDeclarationPluginConfig, v as BindingReplacePluginConfig, w as BindingViteCssPostPluginConfig, x as BindingTransformPluginConfig, y as BindingReporterPluginConfig, z as ResolveResult } from "./shared/binding-CRSqCQIK.mjs";
3
3
 
4
4
  //#region src/api/dev/dev-options.d.ts
5
5
  type DevOnHmrUpdates = (result: Error | {
@@ -173,4 +173,4 @@ type ViteCssPluginConfig = Omit<BindingViteCssPluginConfig, "compileCSS"> & {
173
173
  };
174
174
  declare function viteCSSPlugin(config?: ViteCssPluginConfig): BuiltinPlugin;
175
175
  //#endregion
176
- export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
176
+ export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type MinifyOptions, type MinifyResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, freeExternalMemory, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, minify, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
@@ -1,7 +1,7 @@
1
- import { b as BuiltinPlugin, c as createBundlerOptions, f as normalizeBindingResult, l as normalizedStringOrRegex, m as bindingifySourcemap, p as transformToRollupOutput, s as RolldownBuild, x as makeBuiltinPluginCallable, y as PluginDriver } from "./shared/src-B4ZmdjD5.mjs";
2
- import "./shared/parse-ast-index-Ck5SwMSC.mjs";
1
+ import { b as BuiltinPlugin, c as createBundlerOptions, f as normalizeBindingResult, l as normalizedStringOrRegex, m as bindingifySourcemap, p as transformToRollupOutput, s as RolldownBuild, x as makeBuiltinPluginCallable, y as PluginDriver } from "./shared/src-DE7RBSfl.mjs";
2
+ import "./shared/parse-ast-index-BiBzSGZe.mjs";
3
3
  import "./shared/composable-filters-D_PY7Qa7.mjs";
4
- import { BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
4
+ import { BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, minify, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
5
5
  import { pathToFileURL } from "node:url";
6
6
 
7
7
  //#region src/api/dev/dev-engine.ts
@@ -86,6 +86,47 @@ var DevEngine = class DevEngine {
86
86
  //#region src/api/dev/index.ts
87
87
  const dev = (...args) => DevEngine.create(...args);
88
88
 
89
+ //#endregion
90
+ //#region src/types/external-memory-handle.ts
91
+ const symbolForExternalMemoryHandle = "__rolldown_external_memory_handle__";
92
+ /**
93
+ * Frees the external memory held by the given handle.
94
+ *
95
+ * This is useful when you want to manually release memory held by Rust objects
96
+ * (like `OutputChunk` or `OutputAsset`) before they are garbage collected.
97
+ *
98
+ * @param handle - The object with external memory to free
99
+ * @param keepDataAlive - If true, evaluates all lazy fields before freeing memory (default: false).
100
+ * This will take time to copy data from Rust to JavaScript, but prevents errors
101
+ * when accessing properties after the memory is freed.
102
+ * @returns Status object with `freed` boolean and optional `reason` string.
103
+ * - `{ freed: true }` if memory was successfully freed
104
+ * - `{ freed: false, reason: "..." }` if memory couldn't be freed (e.g., already freed or other references exist)
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * import { freeExternalMemory } from 'rolldown/experimental';
109
+ *
110
+ * const output = await bundle.generate();
111
+ * const chunk = output.output[0];
112
+ *
113
+ * // Use the chunk...
114
+ *
115
+ * // Manually free the memory (fast, but accessing properties after will throw)
116
+ * const status = freeExternalMemory(chunk); // { freed: true }
117
+ * const statusAgain = freeExternalMemory(chunk); // { freed: false, reason: "Memory has already been freed" }
118
+ *
119
+ * // Keep data alive before freeing (slower, but data remains accessible)
120
+ * freeExternalMemory(chunk, true); // Evaluates all lazy fields first
121
+ * console.log(chunk.code); // OK - data was copied to JavaScript before freeing
122
+ *
123
+ * // Without keepDataAlive, accessing chunk properties after freeing will throw an error
124
+ * ```
125
+ */
126
+ function freeExternalMemory(handle, keepDataAlive = false) {
127
+ return handle[symbolForExternalMemoryHandle](keepDataAlive);
128
+ }
129
+
89
130
  //#endregion
90
131
  //#region src/api/experimental.ts
91
132
  /**
@@ -216,10 +257,10 @@ function replacePlugin(values = {}, options = {}) {
216
257
  const value = values[key];
217
258
  if (typeof value !== "string") values[key] = String(value);
218
259
  });
219
- return new BuiltinPlugin("builtin:replace", {
260
+ return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:replace", {
220
261
  ...options,
221
262
  values
222
- });
263
+ }));
223
264
  }
224
265
 
225
266
  //#endregion
@@ -251,4 +292,4 @@ function viteCSSPlugin(config) {
251
292
  }
252
293
 
253
294
  //#endregion
254
- export { BindingRebuildStrategy, DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
295
+ export { BindingRebuildStrategy, DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, freeExternalMemory, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, minify, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
@@ -1,9 +1,13 @@
1
+ /**
2
+ * @typedef {{ type: 'hmr:module-registered', modules: string[] }} DevRuntimeMessage
3
+ * @typedef {{ send(message: DevRuntimeMessage): void }} Messenger
4
+ */
1
5
  export class DevRuntime {
2
6
  /**
3
- * @param {WebSocket} socket
7
+ * @param {Messenger} messenger
4
8
  */
5
- constructor(socket: WebSocket);
6
- socket: WebSocket;
9
+ constructor(messenger: Messenger);
10
+ messenger: Messenger;
7
11
  /**
8
12
  * @type {Record<string, Module>}
9
13
  */
@@ -13,9 +17,9 @@ export class DevRuntime {
13
17
  */
14
18
  createModuleHotContext(_moduleId: string): void;
15
19
  /**
16
- * @param {string[]} _boundaries
20
+ * @param {[string, string][]} _boundaries
17
21
  */
18
- applyUpdates(_boundaries: string[]): void;
22
+ applyUpdates(_boundaries: [string, string][]): void;
19
23
  /**
20
24
  * @param {string} id
21
25
  * @param {{ exports: any }} exportsHolder
@@ -57,6 +61,13 @@ export class DevRuntime {
57
61
  __reExport: any;
58
62
  sendModuleRegisteredMessage: (module: string) => void;
59
63
  }
64
+ export type DevRuntimeMessage = {
65
+ type: "hmr:module-registered";
66
+ modules: string[];
67
+ };
68
+ export type Messenger = {
69
+ send(message: DevRuntimeMessage): void;
70
+ };
60
71
  declare class Module {
61
72
  /**
62
73
  * @param {string} id
@@ -1,4 +1,4 @@
1
- import { k as withFilter } from "./shared/define-config-C6-goOPh.mjs";
2
- import "./shared/binding-DRegrFdE.mjs";
1
+ import { k as withFilter } from "./shared/define-config-pfDd6Le4.mjs";
2
+ import "./shared/binding-CRSqCQIK.mjs";
3
3
  import { and, code, exclude, id, include, moduleType, not, or, queries, query } from "@rolldown/pluginutils";
4
4
  export { and, code, exclude, id, include, moduleType, not, or, queries, query, withFilter };
@@ -1,3 +1,3 @@
1
- import { a as build, i as watch, n as VERSION, o as rolldown, r as defineConfig, t as BindingMagicString } from "./src-CLWy1Uip.js";
1
+ import { a as build, i as watch, n as VERSION, o as rolldown, r as defineConfig, t as BindingMagicString } from "./src-Deywlnh0.js";
2
2
 
3
3
  export { BindingMagicString, VERSION, build, defineConfig, rolldown, watch };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as InternalModuleFormat, At as SourceMap, B as GetModuleInfo, C as ResolveIdResult, Ct as PartialNull, D as SourceDescription, Dt as RenderedChunk, E as RolldownPluginOption, Et as OutputChunk, F as OutputBundle, Ft as LogOrStringHandler, G as PluginContextMeta, H as DefineParallelPluginResult, I as TreeshakingOptions, It as RollupError, J as ModuleTypeFilter, K as GeneralHookFilter, L as TransformPluginContext, Lt as RollupLog, M as ExistingRawSourceMap, Mt as SourcemapIgnoreListOption, N as SourceMapInput, Nt as LogLevel, O as TransformResult, Ot as RenderedModule, P as RolldownOptionsFunction, Pt as LogLevelOption, Q as RolldownFsModule, R as EmittedAsset, Rt as RollupLogWithString, S as ResolveIdExtraOptions, T as RolldownPlugin, Tt as OutputAsset, V as PluginContext, W as MinimalPluginContext, X as RolldownDirectoryEntry, Y as BufferEncoding, Z as RolldownFileStats, _ as ModuleType, _t as GlobalsFunction, a as InputOption, at as RolldownWatcher, b as PartialResolvedId, bt as OutputOptions, c as OptimizationOptions, ct as rolldown, d as CustomPluginOptions, dt as build, et as NormalizedOutputOptions, f as FunctionPluginHooks, ft as AddonFunction, g as ModuleOptions, gt as GeneratedCodePreset, h as LoadResult, ht as GeneratedCodeOptions, i as ExternalOption, it as watch, j as VERSION, jt as ModuleInfo, kt as RolldownOutput, l as WatcherOptions, lt as RolldownBuild, m as ImportKind, mt as ChunkingContext, n as ConfigExport, nt as LoggingFunction, o as InputOptions, ot as RolldownWatcherEvent, p as HookFilterExtension, pt as ChunkFileNamesFunction, q as HookFilter, r as RolldownOptions, rt as WarningHandlerWithDefault, s as ModuleTypes, st as WatchOptions, t as defineConfig, tt as NormalizedInputOptions, u as AsyncPluginHooks, ut as BuildOptions, v as ObjectHook, vt as MinifyOptions, w as ResolvedId, x as Plugin, xt as PreRenderedAsset, y as ParallelPluginHooks, yt as ModuleFormat, z as EmittedFile } from "./shared/define-config-C6-goOPh.mjs";
2
- import { I as PreRenderedChunk, f as BindingMagicString } from "./shared/binding-DRegrFdE.mjs";
1
+ import { $ as InternalModuleFormat, At as SourceMap, B as GetModuleInfo, C as ResolveIdResult, Ct as PartialNull, D as SourceDescription, Dt as RenderedChunk, E as RolldownPluginOption, Et as OutputChunk, F as OutputBundle, Ft as LogLevelOption, G as PluginContextMeta, H as DefineParallelPluginResult, I as TreeshakingOptions, It as LogOrStringHandler, J as ModuleTypeFilter, K as GeneralHookFilter, L as TransformPluginContext, Lt as RollupError, M as ExistingRawSourceMap, Mt as ModuleInfo, N as SourceMapInput, Nt as SourcemapIgnoreListOption, O as TransformResult, Ot as RenderedModule, P as RolldownOptionsFunction, Pt as LogLevel, Q as RolldownFsModule, R as EmittedAsset, Rt as RollupLog, S as ResolveIdExtraOptions, T as RolldownPlugin, Tt as OutputAsset, V as PluginContext, W as MinimalPluginContext, X as RolldownDirectoryEntry, Y as BufferEncoding, Z as RolldownFileStats, _ as ModuleType, _t as GlobalsFunction, a as InputOption, at as RolldownWatcher, b as PartialResolvedId, bt as OutputOptions, c as OptimizationOptions, ct as rolldown, d as CustomPluginOptions, dt as build, et as NormalizedOutputOptions, f as FunctionPluginHooks, ft as AddonFunction, g as ModuleOptions, gt as GeneratedCodePreset, h as LoadResult, ht as GeneratedCodeOptions, i as ExternalOption, it as watch, j as VERSION, kt as RolldownOutput, l as WatcherOptions, lt as RolldownBuild, m as ImportKind, mt as ChunkingContext, n as ConfigExport, nt as LoggingFunction, o as InputOptions, ot as RolldownWatcherEvent, p as HookFilterExtension, pt as ChunkFileNamesFunction, q as HookFilter, r as RolldownOptions, rt as WarningHandlerWithDefault, s as ModuleTypes, st as WatchOptions, t as defineConfig, tt as NormalizedInputOptions, u as AsyncPluginHooks, ut as BuildOptions, v as ObjectHook, vt as MinifyOptions, w as ResolvedId, x as Plugin, xt as PreRenderedAsset, y as ParallelPluginHooks, yt as ModuleFormat, z as EmittedFile, zt as RollupLogWithString } from "./shared/define-config-pfDd6Le4.mjs";
2
+ import { R as PreRenderedChunk, f as BindingMagicString } from "./shared/binding-CRSqCQIK.mjs";
3
3
  export { AddonFunction, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, 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, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { a as build, i as watch, n as VERSION, o as rolldown, r as defineConfig, t as BindingMagicString } from "./shared/src-B4ZmdjD5.mjs";
2
- import "./shared/parse-ast-index-Ck5SwMSC.mjs";
1
+ import { a as build, i as watch, n as VERSION, o as rolldown, r as defineConfig, t as BindingMagicString } from "./shared/src-DE7RBSfl.mjs";
2
+ import "./shared/parse-ast-index-BiBzSGZe.mjs";
3
3
  import "./shared/composable-filters-D_PY7Qa7.mjs";
4
4
 
5
5
  export { BindingMagicString, VERSION, build, defineConfig, rolldown, watch };
@@ -1,5 +1,5 @@
1
- import { d as bindingifyPlugin, u as PluginContextData } from "./shared/src-B4ZmdjD5.mjs";
2
- import "./shared/parse-ast-index-Ck5SwMSC.mjs";
1
+ import { d as bindingifyPlugin, u as PluginContextData } from "./shared/src-DE7RBSfl.mjs";
2
+ import "./shared/parse-ast-index-BiBzSGZe.mjs";
3
3
  import "./shared/composable-filters-D_PY7Qa7.mjs";
4
4
  import { parentPort, workerData } from "node:worker_threads";
5
5
  import { registerPlugins } from "./rolldown-binding.wasi.cjs";
@@ -1,5 +1,5 @@
1
- import { St as MaybePromise, x as Plugin } from "./shared/define-config-C6-goOPh.mjs";
2
- import "./shared/binding-DRegrFdE.mjs";
1
+ import { St as MaybePromise, x as Plugin } from "./shared/define-config-pfDd6Le4.mjs";
2
+ import "./shared/binding-CRSqCQIK.mjs";
3
3
 
4
4
  //#region src/plugin/parallel-plugin-implementation.d.ts
5
5
  type ParallelPluginImplementation = Plugin;
@@ -1,4 +1,4 @@
1
- import { F as ParserOptions, P as ParseResult } from "./shared/binding-DRegrFdE.mjs";
1
+ import { I as ParseResult, L as ParserOptions } from "./shared/binding-CRSqCQIK.mjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
 
4
4
  //#region src/parse-ast-index.d.ts
@@ -1,3 +1,3 @@
1
- import { n as parseAstAsync, t as parseAst } from "./shared/parse-ast-index-Ck5SwMSC.mjs";
1
+ import { n as parseAstAsync, t as parseAst } from "./shared/parse-ast-index-BiBzSGZe.mjs";
2
2
 
3
3
  export { parseAst, parseAstAsync };
@@ -1,6 +1,6 @@
1
1
  import * as _oxc_project_types0 from "@oxc-project/types";
2
2
 
3
- //#region src/binding.d.ts
3
+ //#region src/binding.d.cts
4
4
  type MaybePromise<T> = T | Promise<T>;
5
5
  type VoidNullable<T = void> = T | null | undefined | void;
6
6
  type BindingStringOrRegex = string | RegExp;
@@ -67,6 +67,14 @@ interface CompressOptions {
67
67
  * @default true
68
68
  */
69
69
  sequences?: boolean;
70
+ /**
71
+ * Set of label names to drop from the code.
72
+ *
73
+ * Labeled statements matching these names will be removed during minification.
74
+ *
75
+ * @default []
76
+ */
77
+ dropLabels?: Array<string>;
70
78
  /** Limit the maximum number of iterations for debugging purpose. */
71
79
  maxIterations?: number;
72
80
  }
@@ -118,6 +126,8 @@ interface MangleOptionsKeepNames {
118
126
  */
119
127
  class: boolean;
120
128
  }
129
+ /** Minify synchronously. */
130
+ declare function minify(filename: string, sourceText: string, options?: MinifyOptions | undefined | null): MinifyResult;
121
131
  interface MinifyOptions {
122
132
  /** Use when minifying an ES6 module. */
123
133
  module?: boolean;
@@ -126,6 +136,11 @@ interface MinifyOptions {
126
136
  codegen?: boolean | CodegenOptions;
127
137
  sourcemap?: boolean;
128
138
  }
139
+ interface MinifyResult {
140
+ code: string;
141
+ map?: SourceMap;
142
+ errors: Array<OxcError>;
143
+ }
129
144
  interface Comment {
130
145
  type: 'Line' | 'Block';
131
146
  value: string;
@@ -1196,30 +1211,36 @@ declare class BindingMagicString {
1196
1211
  hasChanged(): boolean;
1197
1212
  length(): number;
1198
1213
  isEmpty(): boolean;
1214
+ remove(start: number, end: number): void;
1215
+ update(start: number, end: number, content: string): void;
1216
+ relocate(start: number, end: number, to: number): void;
1217
+ indent(indentor?: string | undefined | null): void;
1199
1218
  }
1200
1219
  declare class BindingOutputAsset {
1201
- get fileName(): string;
1202
- get originalFileName(): string | null;
1203
- get originalFileNames(): Array<string>;
1204
- get source(): BindingAssetSource;
1205
- get name(): string | null;
1206
- get names(): Array<string>;
1220
+ dropInner(): ExternalMemoryStatus;
1221
+ getFileName(): string;
1222
+ getOriginalFileName(): string | null;
1223
+ getOriginalFileNames(): Array<string>;
1224
+ getSource(): BindingAssetSource;
1225
+ getName(): string | null;
1226
+ getNames(): Array<string>;
1207
1227
  }
1208
1228
  declare class BindingOutputChunk {
1209
- get isEntry(): boolean;
1210
- get isDynamicEntry(): boolean;
1211
- get facadeModuleId(): string | null;
1212
- get moduleIds(): Array<string>;
1213
- get exports(): Array<string>;
1214
- get fileName(): string;
1215
- get modules(): BindingModules;
1216
- get imports(): Array<string>;
1217
- get dynamicImports(): Array<string>;
1218
- get code(): string;
1219
- get map(): string | null;
1220
- get sourcemapFileName(): string | null;
1221
- get preliminaryFileName(): string;
1222
- get name(): string;
1229
+ dropInner(): ExternalMemoryStatus;
1230
+ getIsEntry(): boolean;
1231
+ getIsDynamicEntry(): boolean;
1232
+ getFacadeModuleId(): string | null;
1233
+ getModuleIds(): Array<string>;
1234
+ getExports(): Array<string>;
1235
+ getFileName(): string;
1236
+ getModules(): BindingModules;
1237
+ getImports(): Array<string>;
1238
+ getDynamicImports(): Array<string>;
1239
+ getCode(): string;
1240
+ getMap(): string | null;
1241
+ getSourcemapFileName(): string | null;
1242
+ getPreliminaryFileName(): string;
1243
+ getName(): string;
1223
1244
  }
1224
1245
  declare class BindingRenderedChunk {
1225
1246
  get name(): string;
@@ -1261,7 +1282,7 @@ interface BindingAssetPluginConfig {
1261
1282
  isSkipAssets: boolean;
1262
1283
  assetsInclude: Array<BindingStringOrRegex>;
1263
1284
  assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
1264
- renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => Promise<undefined | string | BindingRenderBuiltUrlRet>;
1285
+ renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => undefined | string | BindingRenderBuiltUrlRet;
1265
1286
  }
1266
1287
  interface BindingAssetSource {
1267
1288
  inner: string | Uint8Array;
@@ -1272,6 +1293,14 @@ interface BindingBuildImportAnalysisPluginConfig {
1272
1293
  optimizeModulePreloadRelativePaths: boolean;
1273
1294
  renderBuiltUrl: boolean;
1274
1295
  isRelativeBase: boolean;
1296
+ v2?: BindingBuildImportAnalysisPluginV2Config;
1297
+ }
1298
+ interface BindingBuildImportAnalysisPluginV2Config {
1299
+ isSsr: boolean;
1300
+ urlBase: string;
1301
+ decodedBase: string;
1302
+ modulePreload: false | BindingModulePreloadOptions;
1303
+ renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => undefined | string | BindingRenderBuiltUrlRet;
1275
1304
  }
1276
1305
  type BindingBuiltinPluginName = 'builtin:alias' | 'builtin:asset' | 'builtin:asset-import-meta-url' | 'builtin:build-import-analysis' | 'builtin:dynamic-import-vars' | 'builtin:esm-external-require' | 'builtin:import-glob' | 'builtin:isolated-declaration' | 'builtin:json' | 'builtin:load-fallback' | 'builtin:manifest' | 'builtin:module-preload-polyfill' | 'builtin:react-refresh-wrapper' | 'builtin:reporter' | 'builtin:replace' | 'builtin:transform' | 'builtin:vite-css' | 'builtin:vite-css-post' | 'builtin:vite-html' | 'builtin:vite-resolve' | 'builtin:wasm-fallback' | 'builtin:wasm-helper' | 'builtin:web-worker-post';
1277
1306
  interface BindingClientHmrUpdate {
@@ -1354,6 +1383,13 @@ interface BindingManifestPluginConfig {
1354
1383
  isLegacy?: () => boolean;
1355
1384
  cssEntries: () => Record<string, string>;
1356
1385
  }
1386
+ interface BindingModulePreloadOptions {
1387
+ polyfill: boolean;
1388
+ resolveDependencies?: (filename: string, deps: string[], context: {
1389
+ hostId: string;
1390
+ hostType: 'html' | 'js';
1391
+ }) => string[];
1392
+ }
1357
1393
  interface BindingModulePreloadPolyfillPluginConfig {
1358
1394
  isServer?: boolean;
1359
1395
  }
@@ -1443,7 +1479,7 @@ interface BindingViteCssPostPluginConfig {
1443
1479
  libCssFilename?: string;
1444
1480
  isLegacy?: () => boolean;
1445
1481
  cssMinify?: (css: string) => Promise<string>;
1446
- renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => Promise<undefined | string | BindingRenderBuiltUrlRet>;
1482
+ renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => undefined | string | BindingRenderBuiltUrlRet;
1447
1483
  }
1448
1484
  interface BindingViteHtmlPluginConfig {
1449
1485
  isLib: boolean;
@@ -1452,13 +1488,9 @@ interface BindingViteHtmlPluginConfig {
1452
1488
  publicDir: string;
1453
1489
  decodedBase: string;
1454
1490
  cssCodeSplit: boolean;
1455
- modulePreloadPolyfill: boolean;
1491
+ modulePreload: false | BindingModulePreloadOptions;
1456
1492
  assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
1457
- renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => Promise<undefined | string | BindingRenderBuiltUrlRet>;
1458
- resolveDependencies?: boolean | ((filename: string, dependencies: string[], context: {
1459
- hostId: string;
1460
- hostType: 'html' | 'js';
1461
- }) => Promise<string[]>);
1493
+ renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => undefined | string | BindingRenderBuiltUrlRet;
1462
1494
  }
1463
1495
  interface BindingViteResolvePluginConfig {
1464
1496
  resolveOptions: BindingViteResolvePluginResolveOptions;
@@ -1495,6 +1527,10 @@ interface BindingViteResolvePluginResolveOptions {
1495
1527
  interface BindingWasmHelperPluginConfig {
1496
1528
  decodedBase: string;
1497
1529
  }
1530
+ interface ExternalMemoryStatus {
1531
+ freed: boolean;
1532
+ reason?: string;
1533
+ }
1498
1534
  /** Error emitted from native side, it only contains kind and message, no stack trace. */
1499
1535
  interface NativeError {
1500
1536
  kind: string;
@@ -1509,4 +1545,4 @@ interface PreRenderedChunk {
1509
1545
  exports: Array<string>;
1510
1546
  }
1511
1547
  //#endregion
1512
- export { IsolatedDeclarationsResult as A, TransformResult as B, BindingViteCssPluginConfig as C, BindingWasmHelperPluginConfig as D, BindingViteResolvePluginConfig as E, ParserOptions as F, moduleRunnerTransform as H, PreRenderedChunk as I, ResolveResult as L, MinifyOptions as M, NapiResolveOptions as N, BindingWatcherEvent as O, ParseResult as P, ResolverFactory as R, BindingUrlResolver as S, BindingViteHtmlPluginConfig as T, transform as U, isolatedDeclaration as V, BindingRenderedChunk as _, BindingClientHmrUpdate as a, BindingTransformHookExtraArgs as b, BindingHookResolveIdExtraArgs as c, BindingJsonPluginConfig as d, BindingMagicString as f, BindingRebuildStrategy as g, BindingReactRefreshWrapperPluginConfig as h, BindingBundlerImpl as i, JsxOptions as j, IsolatedDeclarationsOptions as k, BindingImportGlobPluginConfig as l, BindingModulePreloadPolyfillPluginConfig as m, BindingBuildImportAnalysisPluginConfig as n, BindingDynamicImportVarsPluginConfig as o, BindingManifestPluginConfig as p, BindingBuiltinPluginName as r, BindingEsmExternalRequirePluginConfig as s, BindingAssetPluginConfig as t, BindingIsolatedDeclarationPluginConfig as u, BindingReplacePluginConfig as v, BindingViteCssPostPluginConfig as w, BindingTransformPluginConfig as x, BindingReporterPluginConfig as y, TransformOptions as z };
1548
+ export { IsolatedDeclarationsOptions as A, ResolverFactory as B, BindingViteCssPluginConfig as C, BindingWasmHelperPluginConfig as D, BindingViteResolvePluginConfig as E, NapiResolveOptions as F, moduleRunnerTransform as G, TransformResult as H, ParseResult as I, transform as K, ParserOptions as L, JsxOptions as M, MinifyOptions as N, BindingWatcherEvent as O, MinifyResult as P, PreRenderedChunk as R, BindingUrlResolver as S, BindingViteHtmlPluginConfig as T, isolatedDeclaration as U, TransformOptions as V, minify as W, BindingRenderedChunk as _, BindingClientHmrUpdate as a, BindingTransformHookExtraArgs as b, BindingHookResolveIdExtraArgs as c, BindingJsonPluginConfig as d, BindingMagicString as f, BindingRebuildStrategy as g, BindingReactRefreshWrapperPluginConfig as h, BindingBundlerImpl as i, IsolatedDeclarationsResult as j, ExternalMemoryStatus as k, BindingImportGlobPluginConfig as l, BindingModulePreloadPolyfillPluginConfig as m, BindingBuildImportAnalysisPluginConfig as n, BindingDynamicImportVarsPluginConfig as o, BindingManifestPluginConfig as p, BindingBuiltinPluginName as r, BindingEsmExternalRequirePluginConfig as s, BindingAssetPluginConfig as t, BindingIsolatedDeclarationPluginConfig as u, BindingReplacePluginConfig as v, BindingViteCssPostPluginConfig as w, BindingTransformPluginConfig as x, BindingReporterPluginConfig as y, ResolveResult as z };
@@ -1,4 +1,4 @@
1
- import { F as ParserOptions, I as PreRenderedChunk, M as MinifyOptions$1, O as BindingWatcherEvent, _ as BindingRenderedChunk, b as BindingTransformHookExtraArgs, c as BindingHookResolveIdExtraArgs, f as BindingMagicString, i as BindingBundlerImpl, j as JsxOptions, r as BindingBuiltinPluginName, z as TransformOptions$1 } from "./binding-DRegrFdE.mjs";
1
+ import { L as ParserOptions, M as JsxOptions, N as MinifyOptions$1, O as BindingWatcherEvent, R as PreRenderedChunk, V as TransformOptions$1, _ as BindingRenderedChunk, b as BindingTransformHookExtraArgs, c as BindingHookResolveIdExtraArgs, f as BindingMagicString, i as BindingBundlerImpl, k as ExternalMemoryStatus, r as BindingBuiltinPluginName } from "./binding-CRSqCQIK.mjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
  import { TopLevelFilterExpression } from "@rolldown/pluginutils";
4
4
 
@@ -61,8 +61,59 @@ interface ModuleInfo extends ModuleOptions {
61
61
  //#region src/utils/asset-source.d.ts
62
62
  type AssetSource = string | Uint8Array;
63
63
  //#endregion
64
+ //#region src/types/external-memory-handle.d.ts
65
+ declare const symbolForExternalMemoryHandle: "__rolldown_external_memory_handle__";
66
+ /**
67
+ * Interface for objects that hold external memory that can be explicitly freed.
68
+ */
69
+ interface ExternalMemoryHandle {
70
+ /**
71
+ * Frees the external memory held by this object.
72
+ * @param keepDataAlive - If true, evaluates all lazy fields before freeing memory.
73
+ * This will take time but prevents errors when accessing properties after freeing.
74
+ * @returns Status object with `freed` boolean and optional `reason` string.
75
+ * @internal
76
+ */
77
+ [symbolForExternalMemoryHandle]: (keepDataAlive?: boolean) => ExternalMemoryStatus;
78
+ }
79
+ /**
80
+ * Frees the external memory held by the given handle.
81
+ *
82
+ * This is useful when you want to manually release memory held by Rust objects
83
+ * (like `OutputChunk` or `OutputAsset`) before they are garbage collected.
84
+ *
85
+ * @param handle - The object with external memory to free
86
+ * @param keepDataAlive - If true, evaluates all lazy fields before freeing memory (default: false).
87
+ * This will take time to copy data from Rust to JavaScript, but prevents errors
88
+ * when accessing properties after the memory is freed.
89
+ * @returns Status object with `freed` boolean and optional `reason` string.
90
+ * - `{ freed: true }` if memory was successfully freed
91
+ * - `{ freed: false, reason: "..." }` if memory couldn't be freed (e.g., already freed or other references exist)
92
+ *
93
+ * @example
94
+ * ```typescript
95
+ * import { freeExternalMemory } from 'rolldown/experimental';
96
+ *
97
+ * const output = await bundle.generate();
98
+ * const chunk = output.output[0];
99
+ *
100
+ * // Use the chunk...
101
+ *
102
+ * // Manually free the memory (fast, but accessing properties after will throw)
103
+ * const status = freeExternalMemory(chunk); // { freed: true }
104
+ * const statusAgain = freeExternalMemory(chunk); // { freed: false, reason: "Memory has already been freed" }
105
+ *
106
+ * // Keep data alive before freeing (slower, but data remains accessible)
107
+ * freeExternalMemory(chunk, true); // Evaluates all lazy fields first
108
+ * console.log(chunk.code); // OK - data was copied to JavaScript before freeing
109
+ *
110
+ * // Without keepDataAlive, accessing chunk properties after freeing will throw an error
111
+ * ```
112
+ */
113
+ declare function freeExternalMemory(handle: ExternalMemoryHandle, keepDataAlive?: boolean): ExternalMemoryStatus;
114
+ //#endregion
64
115
  //#region src/types/rolldown-output.d.ts
65
- interface OutputAsset {
116
+ interface OutputAsset extends ExternalMemoryHandle {
66
117
  type: "asset";
67
118
  fileName: string;
68
119
  /** @deprecated Use "originalFileNames" instead. */
@@ -105,7 +156,7 @@ interface RenderedChunk extends Omit<BindingRenderedChunk, "modules"> {
105
156
  imports: Array<string>;
106
157
  dynamicImports: Array<string>;
107
158
  }
108
- interface OutputChunk {
159
+ interface OutputChunk extends ExternalMemoryHandle {
109
160
  type: "chunk";
110
161
  code: string;
111
162
  name: string;
@@ -124,7 +175,7 @@ interface OutputChunk {
124
175
  sourcemapFileName: string | null;
125
176
  preliminaryFileName: string;
126
177
  }
127
- interface RolldownOutput {
178
+ interface RolldownOutput extends ExternalMemoryHandle {
128
179
  output: [OutputChunk, ...(OutputChunk | OutputAsset)[]];
129
180
  }
130
181
  //#endregion
@@ -602,6 +653,9 @@ declare class RolldownBuild {
602
653
  scan(): Promise<void>;
603
654
  generate(outputOptions?: OutputOptions): Promise<RolldownOutput>;
604
655
  write(outputOptions?: OutputOptions): Promise<RolldownOutput>;
656
+ /**
657
+ * Close the build and free resources.
658
+ */
605
659
  close(): Promise<void>;
606
660
  [Symbol.asyncDispose](): Promise<void>;
607
661
  get watchFiles(): Promise<string[]>;
@@ -1647,4 +1701,4 @@ declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
1647
1701
  declare function defineConfig(config: RolldownOptionsFunction): RolldownOptionsFunction;
1648
1702
  declare function defineConfig(config: ConfigExport): ConfigExport;
1649
1703
  //#endregion
1650
- export { InternalModuleFormat as $, BuiltinPlugin as A, SourceMap as At, GetModuleInfo as B, ResolveIdResult as C, PartialNull as Ct, SourceDescription as D, RenderedChunk as Dt, RolldownPluginOption as E, OutputChunk as Et, OutputBundle as F, LogOrStringHandler as Ft, PluginContextMeta as G, DefineParallelPluginResult as H, TreeshakingOptions as I, RollupError as It, ModuleTypeFilter as J, GeneralHookFilter as K, TransformPluginContext as L, RollupLog as Lt, ExistingRawSourceMap as M, SourcemapIgnoreListOption as Mt, SourceMapInput as N, LogLevel as Nt, TransformResult as O, RenderedModule as Ot, RolldownOptionsFunction as P, LogLevelOption as Pt, RolldownFsModule as Q, EmittedAsset as R, RollupLogWithString as Rt, ResolveIdExtraOptions as S, MaybePromise as St, RolldownPlugin as T, OutputAsset as Tt, defineParallelPlugin as U, PluginContext as V, MinimalPluginContext as W, RolldownDirectoryEntry as X, BufferEncoding as Y, RolldownFileStats as Z, ModuleType as _, GlobalsFunction as _t, InputOption as a, RolldownWatcher as at, PartialResolvedId as b, OutputOptions as bt, OptimizationOptions as c, rolldown as ct, CustomPluginOptions as d, build as dt, NormalizedOutputOptions as et, FunctionPluginHooks as f, AddonFunction as ft, ModuleOptions as g, GeneratedCodePreset as gt, LoadResult as h, GeneratedCodeOptions as ht, ExternalOption as i, watch as it, VERSION as j, ModuleInfo as jt, withFilter as k, RolldownOutput as kt, WatcherOptions as l, RolldownBuild as lt, ImportKind as m, ChunkingContext as mt, ConfigExport as n, LoggingFunction as nt, InputOptions as o, RolldownWatcherEvent as ot, HookFilterExtension as p, ChunkFileNamesFunction as pt, HookFilter as q, RolldownOptions as r, WarningHandlerWithDefault as rt, ModuleTypes as s, WatchOptions as st, defineConfig as t, NormalizedInputOptions as tt, AsyncPluginHooks as u, BuildOptions as ut, ObjectHook as v, MinifyOptions as vt, ResolvedId as w, StringOrRegExp as wt, Plugin as x, PreRenderedAsset as xt, ParallelPluginHooks as y, ModuleFormat as yt, EmittedFile as z };
1704
+ export { InternalModuleFormat as $, BuiltinPlugin as A, SourceMap as At, GetModuleInfo as B, ResolveIdResult as C, PartialNull as Ct, SourceDescription as D, RenderedChunk as Dt, RolldownPluginOption as E, OutputChunk as Et, OutputBundle as F, LogLevelOption as Ft, PluginContextMeta as G, DefineParallelPluginResult as H, TreeshakingOptions as I, LogOrStringHandler as It, ModuleTypeFilter as J, GeneralHookFilter as K, TransformPluginContext as L, RollupError as Lt, ExistingRawSourceMap as M, ModuleInfo as Mt, SourceMapInput as N, SourcemapIgnoreListOption as Nt, TransformResult as O, RenderedModule as Ot, RolldownOptionsFunction as P, LogLevel as Pt, RolldownFsModule as Q, EmittedAsset as R, RollupLog as Rt, ResolveIdExtraOptions as S, MaybePromise as St, RolldownPlugin as T, OutputAsset as Tt, defineParallelPlugin as U, PluginContext as V, MinimalPluginContext as W, RolldownDirectoryEntry as X, BufferEncoding as Y, RolldownFileStats as Z, ModuleType as _, GlobalsFunction as _t, InputOption as a, RolldownWatcher as at, PartialResolvedId as b, OutputOptions as bt, OptimizationOptions as c, rolldown as ct, CustomPluginOptions as d, build as dt, NormalizedOutputOptions as et, FunctionPluginHooks as f, AddonFunction as ft, ModuleOptions as g, GeneratedCodePreset as gt, LoadResult as h, GeneratedCodeOptions as ht, ExternalOption as i, watch as it, VERSION as j, freeExternalMemory as jt, withFilter as k, RolldownOutput as kt, WatcherOptions as l, RolldownBuild as lt, ImportKind as m, ChunkingContext as mt, ConfigExport as n, LoggingFunction as nt, InputOptions as o, RolldownWatcherEvent as ot, HookFilterExtension as p, ChunkFileNamesFunction as pt, HookFilter as q, RolldownOptions as r, WarningHandlerWithDefault as rt, ModuleTypes as s, WatchOptions as st, defineConfig as t, NormalizedInputOptions as tt, AsyncPluginHooks as u, BuildOptions as ut, ObjectHook as v, MinifyOptions as vt, ResolvedId as w, StringOrRegExp as wt, Plugin as x, PreRenderedAsset as xt, ParallelPluginHooks as y, ModuleFormat as yt, EmittedFile as z, RollupLogWithString as zt };
@@ -1,4 +1,4 @@
1
- import { o as rolldown } from "./src-B4ZmdjD5.mjs";
1
+ import { o as rolldown } from "./src-DE7RBSfl.mjs";
2
2
  import path from "node:path";
3
3
  import { readdir } from "node:fs/promises";
4
4
  import { pathToFileURL } from "node:url";