@rollipop/rolldown 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +3 -3
- package/dist/experimental-index.d.mts +21 -4
- package/dist/experimental-index.mjs +14 -9
- package/dist/filter-index.d.mts +1 -1
- package/dist/filter-index.mjs +1 -1
- package/dist/get-log-filter.d.mts +3 -3
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +5 -5
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.mts +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +2 -2
- package/dist/plugins-index.d.mts +3 -3
- package/dist/plugins-index.mjs +2 -2
- package/dist/shared/{binding-ZOgiGt4C.mjs → binding-CcS-e42X.mjs} +27 -26
- package/dist/shared/{binding-BAK1LNST.d.mts → binding-DH6N8z26.d.mts} +32 -3
- package/dist/shared/{bindingify-input-options-cmklTSap.mjs → bindingify-input-options-CI-2hKAx.mjs} +31 -15
- package/dist/shared/{constructors-CAy2ANVb.d.mts → constructors-DHgqGLqV.d.mts} +2 -2
- package/dist/shared/{constructors-D_Lvb0Nx.mjs → constructors-JUr2c3nY.mjs} +1 -1
- package/dist/shared/{define-config--ZeBGjK8.d.mts → define-config-CeNECOFF.d.mts} +71 -16
- package/dist/shared/{error-ChzJgXDI.mjs → error-Nb-nFm4f.mjs} +1 -1
- package/dist/shared/{get-log-filter-semyr3Lj.d.mts → get-log-filter-BpNVNJ5-.d.mts} +1 -1
- package/dist/shared/{load-config-DOUsG-mD.mjs → load-config-B8BQ6qW2.mjs} +1 -1
- package/dist/shared/{normalize-string-or-regex-Bp7MBjjd.mjs → normalize-string-or-regex-VP_Pyqdz.mjs} +2 -2
- package/dist/shared/{parse-B1Xb1DP0.mjs → parse-BCHv9CYb.mjs} +2 -2
- package/dist/shared/{prompt-U5ajztzG.mjs → prompt-DYnaB1Nb.mjs} +1 -1
- package/dist/shared/{resolve-tsconfig-DUlqh4Wf.mjs → resolve-tsconfig-D1DmmGCN.mjs} +15 -4
- package/dist/shared/{rolldown-C8g_7RHO.mjs → rolldown-BzA3Eafi.mjs} +1 -1
- package/dist/shared/{rolldown-build-BKTuWCJv.mjs → rolldown-build-Df-vz0Zv.mjs} +57 -67
- package/dist/shared/{transform-CbwKjzKh.d.mts → transform-DlM64_VL.d.mts} +2 -2
- package/dist/shared/{watch-C96Qic5H.mjs → watch-Css1Gn1o.mjs} +6 -6
- package/dist/utils-index.d.mts +3 -3
- package/dist/utils-index.mjs +5 -5
- package/package.json +26 -20
- /package/dist/shared/{define-config-DJOr6Iwt.mjs → define-config-Demdg3_4.mjs} +0 -0
- /package/dist/shared/{logging-C6h4g8dA.d.mts → logging-BSNejiLS.d.mts} +0 -0
- /package/dist/shared/{logs-D80CXhvg.mjs → logs-aMKUxRpj.mjs} +0 -0
- /package/dist/shared/{misc-DJYbNKZX.mjs → misc-CoQm4NHO.mjs} +0 -0
package/dist/shared/{bindingify-input-options-cmklTSap.mjs → bindingify-input-options-CI-2hKAx.mjs}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import { a as logInvalidLogPosition, c as logPluginError, n as error, r as logCycleLoading, t as augmentCodeLocation } from "./logs-
|
|
3
|
-
import { i as bindingifyManifestPlugin, n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-
|
|
4
|
-
import { a as unreachable, o as unsupported, r as noop, t as arraify } from "./misc-
|
|
5
|
-
import { a as bindingifySourcemap, i as unwrapBindingResult, t as aggregateBindingErrorsIntoJsError } from "./error-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-CcS-e42X.mjs";
|
|
2
|
+
import { a as logInvalidLogPosition, c as logPluginError, n as error, r as logCycleLoading, t as augmentCodeLocation } from "./logs-aMKUxRpj.mjs";
|
|
3
|
+
import { i as bindingifyManifestPlugin, n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-VP_Pyqdz.mjs";
|
|
4
|
+
import { a as unreachable, o as unsupported, r as noop, t as arraify } from "./misc-CoQm4NHO.mjs";
|
|
5
|
+
import { a as bindingifySourcemap, i as unwrapBindingResult, t as aggregateBindingErrorsIntoJsError } from "./error-Nb-nFm4f.mjs";
|
|
6
6
|
import { parseAst } from "../parse-ast-index.mjs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import * as filter from "@rollipop/rolldown-pluginutils";
|
|
9
9
|
import fsp from "node:fs/promises";
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "1.0.
|
|
11
|
+
var version = "1.0.10";
|
|
12
12
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/constants/version.ts
|
|
@@ -219,7 +219,7 @@ function bindingAssetSource(source) {
|
|
|
219
219
|
return { inner: source };
|
|
220
220
|
}
|
|
221
221
|
//#endregion
|
|
222
|
-
//#region \0@oxc-project+runtime@0.
|
|
222
|
+
//#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
|
|
223
223
|
function __decorate(decorators, target, key, desc) {
|
|
224
224
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
225
225
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -516,7 +516,7 @@ function transformToOutputBundle(context, output, changed) {
|
|
|
516
516
|
const originalStackTraceLimit = Error.stackTraceLimit;
|
|
517
517
|
Error.stackTraceLimit = 2;
|
|
518
518
|
const message = "This plugin assigns to bundle variable. This is discouraged by Rollup and is not supported by Rolldown. This will be ignored. https://rollupjs.org/plugin-development/#generatebundle:~:text=DANGER,this.emitFile.";
|
|
519
|
-
const stack = new Error(message).stack ?? message;
|
|
519
|
+
const stack = (/* @__PURE__ */ new Error(message)).stack ?? message;
|
|
520
520
|
Error.stackTraceLimit = originalStackTraceLimit;
|
|
521
521
|
context.warn({
|
|
522
522
|
message: stack,
|
|
@@ -674,7 +674,7 @@ function normalizeTransformHookSourcemap(id, originalCode, rawMap) {
|
|
|
674
674
|
return map;
|
|
675
675
|
}
|
|
676
676
|
//#endregion
|
|
677
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
677
|
+
//#region ../../node_modules/.pnpm/remeda@2.34.1/node_modules/remeda/dist/lazyDataLastImpl-DtF3cihj.js
|
|
678
678
|
function e(e, t, n) {
|
|
679
679
|
let r = (n) => e(n, ...t);
|
|
680
680
|
return n === void 0 ? r : Object.assign(r, {
|
|
@@ -683,7 +683,7 @@ function e(e, t, n) {
|
|
|
683
683
|
});
|
|
684
684
|
}
|
|
685
685
|
//#endregion
|
|
686
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
686
|
+
//#region ../../node_modules/.pnpm/remeda@2.34.1/node_modules/remeda/dist/purry.js
|
|
687
687
|
function t$1(t, n, r) {
|
|
688
688
|
let i = t.length - n.length;
|
|
689
689
|
if (i === 0) return t(...n);
|
|
@@ -691,7 +691,7 @@ function t$1(t, n, r) {
|
|
|
691
691
|
throw Error(`Wrong number of arguments`);
|
|
692
692
|
}
|
|
693
693
|
//#endregion
|
|
694
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
694
|
+
//#region ../../node_modules/.pnpm/remeda@2.34.1/node_modules/remeda/dist/partition.js
|
|
695
695
|
function t(...t) {
|
|
696
696
|
return t$1(n, t);
|
|
697
697
|
}
|
|
@@ -1201,7 +1201,7 @@ function bindingifyTransform(args) {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
return {
|
|
1203
1203
|
code: normalizedCode,
|
|
1204
|
-
map: bindingifySourcemap(normalizeTransformHookSourcemap(id, code, map)),
|
|
1204
|
+
map: bindingifySourcemap(normalizeTransformHookSourcemap(id, code, map)) ?? (ret.map === null ? null : void 0),
|
|
1205
1205
|
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0,
|
|
1206
1206
|
moduleType: ret.moduleType
|
|
1207
1207
|
};
|
|
@@ -1257,6 +1257,17 @@ function bindingifyModuleParsed(args) {
|
|
|
1257
1257
|
meta: bindingifyPluginHookMeta(meta)
|
|
1258
1258
|
};
|
|
1259
1259
|
}
|
|
1260
|
+
function bindingifyTransformCacheHit(args) {
|
|
1261
|
+
const hook = args.plugin.transformCacheHit;
|
|
1262
|
+
if (!hook) return {};
|
|
1263
|
+
const { handler, meta } = normalizeHook(hook);
|
|
1264
|
+
return {
|
|
1265
|
+
plugin: async (ctx, id) => {
|
|
1266
|
+
await handler.call(createPluginContext(args, ctx), id);
|
|
1267
|
+
},
|
|
1268
|
+
meta: bindingifyPluginHookMeta(meta)
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1260
1271
|
//#endregion
|
|
1261
1272
|
//#region src/plugin/bindingify-output-hooks.ts
|
|
1262
1273
|
function bindingifyRenderStart(args) {
|
|
@@ -1511,6 +1522,7 @@ function extractHookUsage(plugin) {
|
|
|
1511
1522
|
if (plugin.footer) hookUsage.union(262144);
|
|
1512
1523
|
if (plugin.intro) hookUsage.union(524288);
|
|
1513
1524
|
if (plugin.outro) hookUsage.union(1048576);
|
|
1525
|
+
if (plugin.transformCacheHit) hookUsage.union(2097152);
|
|
1514
1526
|
return hookUsage;
|
|
1515
1527
|
}
|
|
1516
1528
|
//#endregion
|
|
@@ -1546,6 +1558,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1546
1558
|
const { plugin: outro, meta: outroMeta } = bindingifyOutro(args);
|
|
1547
1559
|
const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(args);
|
|
1548
1560
|
const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
|
|
1561
|
+
const { plugin: transformCacheHit, meta: transformCacheHitMeta } = bindingifyTransformCacheHit(args);
|
|
1549
1562
|
let hookUsage = extractHookUsage(plugin).inner();
|
|
1550
1563
|
return wrapHandlers({
|
|
1551
1564
|
name: plugin.name,
|
|
@@ -1593,6 +1606,8 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1593
1606
|
watchChangeMeta,
|
|
1594
1607
|
closeWatcher,
|
|
1595
1608
|
closeWatcherMeta,
|
|
1609
|
+
transformCacheHit,
|
|
1610
|
+
transformCacheHitMeta,
|
|
1596
1611
|
hookUsage
|
|
1597
1612
|
});
|
|
1598
1613
|
}
|
|
@@ -1617,7 +1632,8 @@ function wrapHandlers(plugin) {
|
|
|
1617
1632
|
"intro",
|
|
1618
1633
|
"outro",
|
|
1619
1634
|
"watchChange",
|
|
1620
|
-
"closeWatcher"
|
|
1635
|
+
"closeWatcher",
|
|
1636
|
+
"transformCacheHit"
|
|
1621
1637
|
]) {
|
|
1622
1638
|
const handler = plugin[hookName];
|
|
1623
1639
|
if (handler) plugin[hookName] = async (...args) => {
|
|
@@ -1626,7 +1642,7 @@ function wrapHandlers(plugin) {
|
|
|
1626
1642
|
} catch (e) {
|
|
1627
1643
|
return error(logPluginError(e, plugin.name, {
|
|
1628
1644
|
hook: hookName,
|
|
1629
|
-
id: hookName === "transform" ? args[2] : void 0
|
|
1645
|
+
id: hookName === "transform" ? args[2] : hookName === "transformCacheHit" ? args[1] : void 0
|
|
1630
1646
|
}));
|
|
1631
1647
|
}
|
|
1632
1648
|
};
|
|
@@ -2010,7 +2026,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
2010
2026
|
platform: inputOptions.platform,
|
|
2011
2027
|
shimMissingExports: inputOptions.shimMissingExports,
|
|
2012
2028
|
logLevel: bindingifyLogLevel(logLevel),
|
|
2013
|
-
onLog
|
|
2029
|
+
onLog,
|
|
2014
2030
|
treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
|
|
2015
2031
|
moduleTypes: inputOptions.moduleTypes,
|
|
2016
2032
|
define: normalizedTransform.define,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as BindingViteImportGlobPluginConfig, D as BindingViteReactRefreshWrapperPluginConfig, E as BindingViteModulePreloadPolyfillPluginConfig, O as BindingViteReporterPluginConfig, S as BindingViteDynamicImportVarsPluginConfig, k as BindingViteResolvePluginConfig, l as BindingIsolatedDeclarationPluginConfig, s as BindingEsmExternalRequirePluginConfig, w as BindingViteJsonPluginConfig, x as BindingViteBuildImportAnalysisPluginConfig } from "./binding-
|
|
2
|
-
import {
|
|
1
|
+
import { C as BindingViteImportGlobPluginConfig, D as BindingViteReactRefreshWrapperPluginConfig, E as BindingViteModulePreloadPolyfillPluginConfig, O as BindingViteReporterPluginConfig, S as BindingViteDynamicImportVarsPluginConfig, k as BindingViteResolvePluginConfig, l as BindingIsolatedDeclarationPluginConfig, s as BindingEsmExternalRequirePluginConfig, w as BindingViteJsonPluginConfig, x as BindingViteBuildImportAnalysisPluginConfig } from "./binding-DH6N8z26.mjs";
|
|
2
|
+
import { P as BuiltinPlugin, Ut as StringOrRegExp } from "./define-config-CeNECOFF.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/builtin-plugin/constructors.d.ts
|
|
5
5
|
declare function viteModulePreloadPolyfillPlugin(config?: BindingViteModulePreloadPolyfillPluginConfig): BuiltinPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-VP_Pyqdz.mjs";
|
|
2
2
|
//#region src/builtin-plugin/constructors.ts
|
|
3
3
|
function viteModulePreloadPolyfillPlugin(config) {
|
|
4
4
|
return new BuiltinPlugin("builtin:vite-module-preload-polyfill", config);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./logging-
|
|
2
|
-
import { B as ParserOptions, F as JsxOptions, G as TransformOptions$1, I as MinifyOptions$1, M as ExternalMemoryStatus, V as PreRenderedChunk, _ as BindingTransformHookExtraArgs, c as BindingHookResolveIdExtraArgs, d as BindingPluginContextResolveOptions, j as BindingWatcherBundler, p as BindingRenderedChunk, t as BindingBuiltinPluginName, u as BindingMagicString } from "./binding-
|
|
1
|
+
import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./logging-BSNejiLS.mjs";
|
|
2
|
+
import { B as ParserOptions, F as JsxOptions, G as TransformOptions$1, I as MinifyOptions$1, M as ExternalMemoryStatus, V as PreRenderedChunk, _ as BindingTransformHookExtraArgs, c as BindingHookResolveIdExtraArgs, d as BindingPluginContextResolveOptions, j as BindingWatcherBundler, p as BindingRenderedChunk, t as BindingBuiltinPluginName, u as BindingMagicString } from "./binding-DH6N8z26.mjs";
|
|
3
3
|
import { TopLevelFilterExpression } from "@rollipop/rolldown-pluginutils";
|
|
4
4
|
import { Program } from "@oxc-project/types";
|
|
5
5
|
|
|
@@ -861,8 +861,6 @@ interface OutputOptions {
|
|
|
861
861
|
*
|
|
862
862
|
* When both `legalComments` and `comments.legal` are set, `comments.legal` takes priority.
|
|
863
863
|
*
|
|
864
|
-
*
|
|
865
|
-
*
|
|
866
864
|
* @default true
|
|
867
865
|
*/
|
|
868
866
|
comments?: boolean | CommentsOptions;
|
|
@@ -906,9 +904,18 @@ interface OutputOptions {
|
|
|
906
904
|
*/
|
|
907
905
|
preserveModulesRoot?: string;
|
|
908
906
|
/**
|
|
909
|
-
* Whether to
|
|
907
|
+
* Whether to convert top-level `let` and `const` declarations into `var` declarations.
|
|
910
908
|
*
|
|
911
|
-
* Enabling this option can improve runtime performance of the generated code in
|
|
909
|
+
* Enabling this option can improve runtime performance of the generated code in
|
|
910
|
+
* certain environments by avoiding Temporal Dead Zone (TDZ) checks. Only declarations
|
|
911
|
+
* in the module's top-level scope are rewritten — declarations inside nested scopes
|
|
912
|
+
* (functions, blocks, etc.) are left as-is.
|
|
913
|
+
*
|
|
914
|
+
* Note:
|
|
915
|
+
* - Top-level `class X {}` declarations are always emitted as `var X = class {}` so
|
|
916
|
+
* rolldown can hoist them alongside other top-level bindings; this transform is
|
|
917
|
+
* independent of `topLevelVar`.
|
|
918
|
+
* - Top-level `function` declarations are never rewritten.
|
|
912
919
|
*
|
|
913
920
|
* @default false
|
|
914
921
|
*
|
|
@@ -1513,6 +1520,15 @@ interface ChecksOptions {
|
|
|
1513
1520
|
* */
|
|
1514
1521
|
missingNameOptionForIifeExport?: boolean;
|
|
1515
1522
|
/**
|
|
1523
|
+
* Whether to emit warnings when a `#__PURE__` / `@__PURE__` annotation has no effect due to its position.
|
|
1524
|
+
*
|
|
1525
|
+
* Annotations placed where they cannot annotate a call expression (e.g. before a non-call expression,
|
|
1526
|
+
* before a statement declaration, or between an identifier and `=` in a variable declarator) are
|
|
1527
|
+
* ignored by the parser. Matches Rollup's `INVALID_ANNOTATION` log code.
|
|
1528
|
+
* @default true
|
|
1529
|
+
* */
|
|
1530
|
+
invalidAnnotation?: boolean;
|
|
1531
|
+
/**
|
|
1516
1532
|
* Whether to emit warnings when the way to export values is ambiguous.
|
|
1517
1533
|
*
|
|
1518
1534
|
* See [`output.exports`](https://rolldown.rs/reference/OutputOptions.exports).
|
|
@@ -1620,6 +1636,17 @@ interface ChecksOptions {
|
|
|
1620
1636
|
* @default true
|
|
1621
1637
|
* */
|
|
1622
1638
|
ineffectiveDynamicImport?: boolean;
|
|
1639
|
+
/**
|
|
1640
|
+
* Whether to emit info logs when a barrel module has a very large number of re-exports (more than 5000).
|
|
1641
|
+
*
|
|
1642
|
+
* Such modules can significantly slow down module resolution. Consider using
|
|
1643
|
+
* [`@rolldown/plugin-transform-imports`](https://github.com/rolldown/plugins/tree/main/packages/transform-imports)
|
|
1644
|
+
* to rewrite barrel imports at the source level so the barrel file is never loaded.
|
|
1645
|
+
*
|
|
1646
|
+
* See [Large barrel modules](https://rolldown.rs/in-depth/lazy-barrel-optimization#large-barrel-modules) for more details.
|
|
1647
|
+
* @default true
|
|
1648
|
+
* */
|
|
1649
|
+
largeBarrelModules?: boolean;
|
|
1623
1650
|
}
|
|
1624
1651
|
//#endregion
|
|
1625
1652
|
//#region src/options/transform-options.d.ts
|
|
@@ -2551,7 +2578,7 @@ declare class BuiltinPlugin {
|
|
|
2551
2578
|
}
|
|
2552
2579
|
//#endregion
|
|
2553
2580
|
//#region src/constants/plugin.d.ts
|
|
2554
|
-
declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"];
|
|
2581
|
+
declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange", "transformCacheHit"];
|
|
2555
2582
|
declare const ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES: readonly ["augmentChunkHash", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "generateBundle"];
|
|
2556
2583
|
declare const ENUMERATED_PLUGIN_HOOK_NAMES: [...typeof ENUMERATED_INPUT_PLUGIN_HOOK_NAMES, ...typeof ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES, "footer", "banner", "intro", "outro"];
|
|
2557
2584
|
/**
|
|
@@ -2971,6 +2998,7 @@ interface FunctionPluginHooks {
|
|
|
2971
2998
|
* @group Build Hooks
|
|
2972
2999
|
*/
|
|
2973
3000
|
[DEFINED_HOOK_NAMES.closeWatcher]: (this: PluginContext) => void;
|
|
3001
|
+
[DEFINED_HOOK_NAMES.transformCacheHit]: (this: PluginContext, id: string) => void;
|
|
2974
3002
|
}
|
|
2975
3003
|
type ChangeEvent = "create" | "update" | "delete";
|
|
2976
3004
|
type PluginOrder = "pre" | "post" | null;
|
|
@@ -2995,7 +3023,7 @@ type SyncPluginHooks = DefinedHookNames["augmentChunkHash" | "onLog" | "outputOp
|
|
|
2995
3023
|
/** @category Plugin APIs */
|
|
2996
3024
|
type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
|
|
2997
3025
|
type FirstPluginHooks = DefinedHookNames["load" | "resolveDynamicImport" | "resolveId"];
|
|
2998
|
-
type SequentialPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "onLog" | "options" | "outputOptions" | "renderChunk" | "transform"];
|
|
3026
|
+
type SequentialPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "onLog" | "options" | "outputOptions" | "renderChunk" | "transform" | "transformCacheHit"];
|
|
2999
3027
|
interface AddonHooks {
|
|
3000
3028
|
/**
|
|
3001
3029
|
* A hook equivalent to {@linkcode OutputOptions.banner | output.banner} option.
|
|
@@ -3091,6 +3119,28 @@ type InputOption = string | string[] | Record<string, string>;
|
|
|
3091
3119
|
type ExternalOptionFunction = (id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>;
|
|
3092
3120
|
/** @inline */
|
|
3093
3121
|
type ExternalOption = StringOrRegExp | StringOrRegExp[] | ExternalOptionFunction;
|
|
3122
|
+
interface ChunkOptimizationOptions {
|
|
3123
|
+
/**
|
|
3124
|
+
* Merge common chunks into existing entry chunks when it is safe.
|
|
3125
|
+
*
|
|
3126
|
+
* This can reduce the number of emitted chunks by moving shared/common modules
|
|
3127
|
+
* into an entry chunk that already depends on them. Rolldown only applies the
|
|
3128
|
+
* merge when it does not create a circular chunk dependency or change strict
|
|
3129
|
+
* entry export signatures. This pass also covers safe empty-facade cleanup.
|
|
3130
|
+
*
|
|
3131
|
+
* @default true
|
|
3132
|
+
*/
|
|
3133
|
+
mergeCommonChunks?: boolean;
|
|
3134
|
+
/**
|
|
3135
|
+
* Avoid emitting redundant chunk loads for dynamic entries.
|
|
3136
|
+
*
|
|
3137
|
+
* This pass can reduce dynamic-entry dependent chunks when the shared modules
|
|
3138
|
+
* are guaranteed to be loaded by every importer of that dynamic entry.
|
|
3139
|
+
*
|
|
3140
|
+
* @default true
|
|
3141
|
+
*/
|
|
3142
|
+
avoidRedundantChunkLoads?: boolean;
|
|
3143
|
+
}
|
|
3094
3144
|
type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset" | "copy">;
|
|
3095
3145
|
interface WatcherFileWatcherOptions {
|
|
3096
3146
|
/**
|
|
@@ -3694,18 +3744,18 @@ interface InputOptions {
|
|
|
3694
3744
|
*/
|
|
3695
3745
|
nativeMagicString?: boolean;
|
|
3696
3746
|
/**
|
|
3697
|
-
* Control
|
|
3698
|
-
* This optimization can reduce the number of generated chunks.
|
|
3747
|
+
* Control chunk optimizations.
|
|
3699
3748
|
*
|
|
3700
|
-
*
|
|
3701
|
-
*
|
|
3749
|
+
* `true` enables both common-chunk merging and redundant dynamic chunk-load avoidance.
|
|
3750
|
+
* `false` disables all chunk optimizations. Use the object form to control
|
|
3751
|
+
* `mergeCommonChunks` and `avoidRedundantChunkLoads` separately.
|
|
3702
3752
|
*
|
|
3703
|
-
*
|
|
3704
|
-
* as
|
|
3753
|
+
* These optimizations are automatically disabled when any module uses top-level await (TLA) or contains TLA dependencies,
|
|
3754
|
+
* as they could affect execution order guarantees.
|
|
3705
3755
|
*
|
|
3706
3756
|
* @default true
|
|
3707
3757
|
*/
|
|
3708
|
-
chunkOptimization?: boolean;
|
|
3758
|
+
chunkOptimization?: boolean | ChunkOptimizationOptions;
|
|
3709
3759
|
/**
|
|
3710
3760
|
* Control whether to enable lazy barrel optimization.
|
|
3711
3761
|
*
|
|
@@ -3760,6 +3810,11 @@ interface InputOptions {
|
|
|
3760
3810
|
makeAbsoluteExternalsRelative?: MakeAbsoluteExternalsRelative;
|
|
3761
3811
|
/**
|
|
3762
3812
|
* Devtools integration options.
|
|
3813
|
+
*
|
|
3814
|
+
* When enabled, Rolldown writes JSON-lines devtools output under
|
|
3815
|
+
* `node_modules/.rolldown/{session_id}/`. Consumers can parse the output with
|
|
3816
|
+
* `@rolldown/debug` after `await bundle.close()` resolves.
|
|
3817
|
+
*
|
|
3763
3818
|
* @experimental
|
|
3764
3819
|
*/
|
|
3765
3820
|
devtools?: {
|
|
@@ -3841,4 +3896,4 @@ declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
|
3841
3896
|
declare function defineConfig(config: RolldownOptionsFunction): RolldownOptionsFunction;
|
|
3842
3897
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
3843
3898
|
//#endregion
|
|
3844
|
-
export {
|
|
3899
|
+
export { PluginContextMeta as $, RolldownPluginOption as A, CodeSplittingGroup as At, OutputBundle as B, PreRenderedAsset as Bt, ParallelPluginHooks as C, build as Ct, ResolveIdResult as D, BuiltinModuleTag as Dt, ResolveIdExtraOptions as E, AdvancedChunksOptions as Et, RUNTIME_MODULE_ID as F, GeneratedCodePreset as Ft, EmittedFile as G, OutputChunk as Gt, TransformPluginContext as H, PartialNull as Ht, VERSION as I, GlobalsFunction as It, PluginContext as J, RolldownOutput as Jt, EmittedPrebuiltChunk as K, RenderedChunk as Kt, BundleError as L, MinifyOptions as Lt, TransformResult as M, CodeSplittingOptions as Mt, withFilter as N, CommentsOptions as Nt, ResolvedId as O, ChunkFileNamesFunction as Ot, BuiltinPlugin as P, GeneratedCodeOptions as Pt, MinimalPluginContext as Q, SourcemapIgnoreListOption as Qt, ExistingRawSourceMap as R, ModuleFormat as Rt, ObjectHook as S, BuildOptions as St, Plugin as T, AdvancedChunksGroup as Tt, EmittedAsset as U, StringOrRegExp as Ut, TreeshakingOptions as V, MaybePromise as Vt, EmittedChunk as W, OutputAsset as Wt, DefineParallelPluginResult as X, freeExternalMemory as Xt, PluginContextResolveOptions as Y, SourceMap as Yt, defineParallelPlugin as Z, ModuleInfo as Zt, HookFilterExtension as _, RolldownWatcherEvent as _t, ChunkOptimizationOptions as a, RolldownFileStats as at, ModuleOptions as b, rolldown as bt, InputOption as c, NormalizedOutputOptions as ct, OptimizationOptions as d, ChecksOptions as dt, GeneralHookFilter as et, WatcherFileWatcherOptions as f, LoggingFunction as ft, FunctionPluginHooks as g, RolldownWatcher as gt, CustomPluginOptions as h, watch as ht, RolldownOptions as i, RolldownDirectoryEntry as it, SourceDescription as j, CodeSplittingNameFunction as jt, RolldownPlugin as k, ChunkingContext as kt, InputOptions as l, NormalizedInputOptions as lt, AsyncPluginHooks as m, RolldownMagicString as mt, RolldownOptionsFunction as n, ModuleTypeFilter as nt, ExternalOption as o, RolldownFsModule as ot, WatcherOptions as p, WarningHandlerWithDefault as pt, GetModuleInfo as q, RenderedModule as qt, defineConfig as r, BufferEncoding as rt, ExternalOptionFunction as s, InternalModuleFormat as st, ConfigExport as t, HookFilter as tt, ModuleTypes as u, TransformOptions as ut, ImportKind as v, RolldownWatcherWatcherEventMap as vt, PartialResolvedId as w, AddonFunction as wt, ModuleType as x, RolldownBuild as xt, LoadResult as y, WatchOptions as yt, SourceMapInput as z, OutputOptions as zt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import { c as logPluginError, n as error } from "./logs-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-CcS-e42X.mjs";
|
|
2
|
+
import { c as logPluginError, n as error } from "./logs-aMKUxRpj.mjs";
|
|
3
3
|
//#region src/builtin-plugin/utils.ts
|
|
4
4
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5
5
|
var BuiltinPlugin = class {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-CcS-e42X.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.133.0/node_modules/oxc-parser/src-js/wrap.js
|
|
3
3
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
4
4
|
function wrap(result) {
|
|
5
5
|
let program, module, comments, errors;
|
|
@@ -134,7 +134,7 @@ function requirePicocolors() {
|
|
|
134
134
|
picocolors.exports.createColors = createColors;
|
|
135
135
|
return picocolors.exports;
|
|
136
136
|
}
|
|
137
|
-
const e =
|
|
137
|
+
const e = /*@__PURE__*/ getDefaultExportFromCjs(/* @__PURE__ */ requirePicocolors());
|
|
138
138
|
function J({ onlyFirst: t = false } = {}) {
|
|
139
139
|
const F = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
|
|
140
140
|
return new RegExp(F, t ? void 0 : "g");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-CcS-e42X.mjs";
|
|
2
|
+
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-Nb-nFm4f.mjs";
|
|
3
3
|
//#region src/utils/minify.ts
|
|
4
4
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5
5
|
/**
|
|
@@ -37,6 +37,17 @@ function minifySync(filename, sourceText, options) {
|
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/utils/transform.ts
|
|
39
39
|
const yarnPnp$1 = typeof process === "object" && !!process.versions?.pnp;
|
|
40
|
+
function normalizeBindingWarning(warning) {
|
|
41
|
+
if (warning.type === "JsError") return warning.field0;
|
|
42
|
+
return {
|
|
43
|
+
code: warning.field0.kind,
|
|
44
|
+
message: warning.field0.message,
|
|
45
|
+
id: warning.field0.id,
|
|
46
|
+
exporter: warning.field0.exporter,
|
|
47
|
+
loc: warning.field0.loc,
|
|
48
|
+
pos: warning.field0.pos
|
|
49
|
+
};
|
|
50
|
+
}
|
|
40
51
|
/**
|
|
41
52
|
* Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
|
|
42
53
|
*
|
|
@@ -60,7 +71,7 @@ async function transform(filename, sourceText, options, cache) {
|
|
|
60
71
|
return {
|
|
61
72
|
...result,
|
|
62
73
|
errors: result.errors.map(normalizeBindingError),
|
|
63
|
-
warnings: result.warnings.map(
|
|
74
|
+
warnings: result.warnings.map(normalizeBindingWarning)
|
|
64
75
|
};
|
|
65
76
|
}
|
|
66
77
|
/**
|
|
@@ -84,7 +95,7 @@ function transformSync(filename, sourceText, options, cache) {
|
|
|
84
95
|
return {
|
|
85
96
|
...result,
|
|
86
97
|
errors: result.errors.map(normalizeBindingError),
|
|
87
|
-
warnings: result.warnings.map(
|
|
98
|
+
warnings: result.warnings.map(normalizeBindingWarning)
|
|
88
99
|
};
|
|
89
100
|
}
|
|
90
101
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as validateOption, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-
|
|
1
|
+
import { c as validateOption, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-Df-vz0Zv.mjs";
|
|
2
2
|
//#region src/api/rolldown/index.ts
|
|
3
3
|
/**
|
|
4
4
|
* The API compatible with Rollup's `rollup` function.
|