rolldown 1.0.0-beta.43 → 1.0.0-beta.45

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.
@@ -45,13 +45,30 @@ interface CompressOptions {
45
45
  */
46
46
  dropDebugger?: boolean;
47
47
  /**
48
- * Drop unreferenced functions and variables.
48
+ * Pass `true` to drop unreferenced functions and variables.
49
49
  *
50
- * Simple direct variable assignments do not count as references unless set to "keep_assign".
50
+ * Simple direct variable assignments do not count as references unless set to `keep_assign`.
51
+ * @default true
51
52
  */
52
- unused?: true | false | 'keep_assign';
53
+ unused?: boolean | 'keep_assign';
53
54
  /** Keep function / class names. */
54
55
  keepNames?: CompressOptionsKeepNames;
56
+ /**
57
+ * Join consecutive var, let and const statements.
58
+ *
59
+ * @default true
60
+ */
61
+ joinVars?: boolean;
62
+ /**
63
+ * Join consecutive simple statements using the comma operator.
64
+ *
65
+ * `a; b` -> `a, b`
66
+ *
67
+ * @default true
68
+ */
69
+ sequences?: boolean;
70
+ /** Limit the maximum number of iterations for debugging purpose. */
71
+ maxIterations?: number;
55
72
  }
56
73
  interface CompressOptionsKeepNames {
57
74
  /**
@@ -377,11 +394,11 @@ type ModuleType = 'module' | 'commonjs' | 'json' | 'wasm' | 'addon';
377
394
  */
378
395
  interface NapiResolveOptions {
379
396
  /**
380
- * Path to TypeScript configuration file.
397
+ * Discover tsconfig automatically or use the specified tsconfig.json path.
381
398
  *
382
399
  * Default `None`
383
400
  */
384
- tsconfig?: TsconfigOptions;
401
+ tsconfig?: 'auto' | TsconfigOptions;
385
402
  /**
386
403
  * Alias for [ResolveOptions::alias] and [ResolveOptions::fallback].
387
404
  *
@@ -1204,10 +1221,6 @@ declare class BindingOutputChunk {
1204
1221
  get preliminaryFileName(): string;
1205
1222
  get name(): string;
1206
1223
  }
1207
- declare class BindingOutputs {
1208
- get chunks(): Array<BindingOutputChunk>;
1209
- get assets(): Array<BindingOutputAsset>;
1210
- }
1211
1224
  declare class BindingRenderedChunk {
1212
1225
  get name(): string;
1213
1226
  get isEntry(): boolean;
@@ -1224,6 +1237,9 @@ declare class BindingRenderedModule {
1224
1237
  get code(): string | null;
1225
1238
  get renderedExports(): Array<string>;
1226
1239
  }
1240
+ declare class BindingUrlResolver {
1241
+ call(url: string, importer?: string): Promise<[string, string | undefined]>;
1242
+ }
1227
1243
  declare class BindingWatcherChangeData {
1228
1244
  path: string;
1229
1245
  kind: string;
@@ -1236,16 +1252,16 @@ declare class BindingWatcherEvent {
1236
1252
  bundleErrorData(): BindingBundleErrorEventData;
1237
1253
  }
1238
1254
  interface BindingAssetPluginConfig {
1239
- isLib?: boolean;
1240
- isSsr?: boolean;
1241
- isWorker?: boolean;
1242
- urlBase?: string;
1243
- publicDir?: string;
1244
- decodedBase?: string;
1245
- isSkipAssets?: boolean;
1246
- assetsInclude?: Array<BindingStringOrRegex>;
1247
- assetInlineLimit?: number | ((file: string, content: Buffer) => boolean | undefined);
1248
- renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => MaybePromise<VoidNullable<string | BindingRenderBuiltUrlRet>>;
1255
+ isLib: boolean;
1256
+ isSsr: boolean;
1257
+ isWorker: boolean;
1258
+ urlBase: string;
1259
+ publicDir: string;
1260
+ decodedBase: string;
1261
+ isSkipAssets: boolean;
1262
+ assetsInclude: Array<BindingStringOrRegex>;
1263
+ assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
1264
+ renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => Promise<undefined | string | BindingRenderBuiltUrlRet>;
1249
1265
  }
1250
1266
  interface BindingAssetSource {
1251
1267
  inner: string | Uint8Array;
@@ -1257,7 +1273,7 @@ interface BindingBuildImportAnalysisPluginConfig {
1257
1273
  renderBuiltUrl: boolean;
1258
1274
  isRelativeBase: boolean;
1259
1275
  }
1260
- type BindingBuiltinPluginName = 'builtin:alias' | 'builtin:asset' | 'builtin:asset-import-meta-url' | 'builtin:build-import-analysis' | 'builtin:dynamic-import-vars' | '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:esm-external-require' | 'builtin:transform' | 'builtin:vite-resolve' | 'builtin:wasm-fallback' | 'builtin:wasm-helper' | 'builtin:web-worker-post';
1276
+ 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';
1261
1277
  interface BindingClientHmrUpdate {
1262
1278
  clientId: string;
1263
1279
  update: BindingHmrUpdate;
@@ -1322,11 +1338,21 @@ interface BindingJsonPluginConfig {
1322
1338
  stringify?: BindingJsonPluginStringify;
1323
1339
  }
1324
1340
  type BindingJsonPluginStringify = boolean | string;
1341
+ interface BindingJsonSourcemap {
1342
+ file?: string;
1343
+ mappings?: string;
1344
+ sourceRoot?: string;
1345
+ sources?: Array<string | undefined | null>;
1346
+ sourcesContent?: Array<string | undefined | null>;
1347
+ names?: Array<string>;
1348
+ debugId?: string;
1349
+ x_google_ignoreList?: Array<number>;
1350
+ }
1325
1351
  interface BindingManifestPluginConfig {
1326
1352
  root: string;
1327
1353
  outPath: string;
1328
1354
  isLegacy?: () => boolean;
1329
- cssEntries: () => Set<string>;
1355
+ cssEntries: () => Record<string, string>;
1330
1356
  }
1331
1357
  interface BindingModulePreloadPolyfillPluginConfig {
1332
1358
  isServer?: boolean;
@@ -1335,6 +1361,10 @@ interface BindingModules {
1335
1361
  values: Array<BindingRenderedModule>;
1336
1362
  keys: Array<string>;
1337
1363
  }
1364
+ interface BindingOutputs {
1365
+ chunks: Array<BindingOutputChunk>;
1366
+ assets: Array<BindingOutputAsset>;
1367
+ }
1338
1368
  interface BindingReactRefreshWrapperPluginConfig {
1339
1369
  cwd: string;
1340
1370
  include?: Array<BindingStringOrRegex>;
@@ -1373,6 +1403,9 @@ interface BindingReporterPluginConfig {
1373
1403
  warnLargeChunks: boolean;
1374
1404
  reportCompressedSize: boolean;
1375
1405
  }
1406
+ interface BindingSourcemap {
1407
+ inner: string | BindingJsonSourcemap;
1408
+ }
1376
1409
  interface BindingTransformHookExtraArgs {
1377
1410
  moduleType: string;
1378
1411
  }
@@ -1385,6 +1418,48 @@ interface BindingTransformPluginConfig {
1385
1418
  jsxInject?: string;
1386
1419
  transformOptions?: TransformOptions;
1387
1420
  }
1421
+ interface BindingViteCssPluginConfig {
1422
+ isLib: boolean;
1423
+ publicDir: string;
1424
+ compileCSS: (url: string, importer: string, resolver: BindingUrlResolver) => Promise<{
1425
+ code: string;
1426
+ map?: BindingSourcemap;
1427
+ modules?: Record<string, string>;
1428
+ deps?: Set<string>;
1429
+ }>;
1430
+ resolveUrl: (url: string, importer?: string) => MaybePromise<string | undefined>;
1431
+ assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
1432
+ }
1433
+ interface BindingViteCssPostPluginConfig {
1434
+ isLib: boolean;
1435
+ isSsr: boolean;
1436
+ isWorker: boolean;
1437
+ isClient: boolean;
1438
+ cssCodeSplit: boolean;
1439
+ sourcemap: boolean;
1440
+ assetsDir: string;
1441
+ urlBase: string;
1442
+ decodedBase: string;
1443
+ libCssFilename?: string;
1444
+ isLegacy?: () => boolean;
1445
+ cssMinify?: (css: string) => Promise<string>;
1446
+ renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => Promise<undefined | string | BindingRenderBuiltUrlRet>;
1447
+ }
1448
+ interface BindingViteHtmlPluginConfig {
1449
+ isLib: boolean;
1450
+ isSsr: boolean;
1451
+ urlBase: string;
1452
+ publicDir: string;
1453
+ decodedBase: string;
1454
+ cssCodeSplit: boolean;
1455
+ modulePreloadPolyfill: boolean;
1456
+ 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[]>);
1462
+ }
1388
1463
  interface BindingViteResolvePluginConfig {
1389
1464
  resolveOptions: BindingViteResolvePluginResolveOptions;
1390
1465
  environmentConsumer: string;
@@ -1393,6 +1468,7 @@ interface BindingViteResolvePluginConfig {
1393
1468
  external: true | string[];
1394
1469
  noExternal: true | Array<string | RegExp>;
1395
1470
  dedupe: Array<string>;
1471
+ legacyInconsistentCjsInterop?: boolean;
1396
1472
  finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string>;
1397
1473
  finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string>;
1398
1474
  resolveSubpathImports: (id: string, importer: string, isRequire: boolean, scan: boolean) => VoidNullable<string>;
@@ -1433,4 +1509,4 @@ interface PreRenderedChunk {
1433
1509
  exports: Array<string>;
1434
1510
  }
1435
1511
  //#endregion
1436
- export { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingClientHmrUpdate, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingMagicString, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingOutputs, BindingReactRefreshWrapperPluginConfig, BindingRebuildStrategy, BindingRenderedChunk, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, MinifyOptions, NapiResolveOptions, ParseResult, ParserOptions, PreRenderedChunk, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform };
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 };