@rolldown/browser 1.0.0-beta.51 → 1.0.0-beta.53

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 (34) hide show
  1. package/dist/cli.mjs +8 -10
  2. package/dist/config.d.mts +1 -3
  3. package/dist/config.mjs +6 -9
  4. package/dist/{constructors-DoUEJY6G.js → constructors-YnYYKXAq.js} +5 -8
  5. package/dist/experimental-index.browser.mjs +23 -11
  6. package/dist/experimental-index.d.mts +31 -9
  7. package/dist/experimental-index.mjs +25 -16
  8. package/dist/filter-index.d.mts +1 -3
  9. package/dist/index.browser.mjs +2 -2
  10. package/dist/index.d.mts +3 -3
  11. package/dist/index.mjs +6 -9
  12. package/dist/{normalize-string-or-regex-BXFT9GiS.js → normalize-string-or-regex-BVvsez4S.js} +41 -4
  13. package/dist/parallel-plugin-worker.mjs +3 -6
  14. package/dist/parallel-plugin.d.mts +2 -3
  15. package/dist/parse-ast-index.d.mts +1 -1
  16. package/dist/parse-ast-index.mjs +1 -2
  17. package/dist/plugins-index.browser.mjs +2 -2
  18. package/dist/plugins-index.d.mts +3 -3
  19. package/dist/plugins-index.mjs +2 -4
  20. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  21. package/dist/{rolldown-build-C0UB1WZy.js → rolldown-build-DdLgyfGg.js} +353 -191
  22. package/dist/shared/{binding-lSvYApx7.d.mts → binding-CY7Z709f.d.mts} +59 -12
  23. package/dist/shared/{bindingify-input-options-CSdAtTcQ.mjs → bindingify-input-options-DcGFRvkp.mjs} +7 -5
  24. package/dist/shared/{constructors-DF6M1PTb.mjs → constructors-Bi2whoYR.mjs} +5 -8
  25. package/dist/shared/{constructors-DgFF472b.d.mts → constructors-S9gqtBdT.d.mts} +4 -5
  26. package/dist/shared/{define-config-BKu-xa_0.d.mts → define-config-CPSppdHs.d.mts} +23 -10
  27. package/dist/shared/{load-config-Beo_LOwd.mjs → load-config-B09j7Dnd.mjs} +1 -1
  28. package/dist/shared/{normalize-string-or-regex-DvECZN2V.mjs → normalize-string-or-regex-Bsz_9HAl.mjs} +41 -4
  29. package/dist/shared/{parse-ast-index-C_M-Y4oC.mjs → parse-ast-index-BOAjpcDq.mjs} +19 -5
  30. package/dist/shared/{rolldown-build-DYR94CyF.mjs → rolldown-build-CyazSAHY.mjs} +334 -188
  31. package/dist/shared/{rolldown-BhV7L6Kg.mjs → rolldown-vJGs7rCs.mjs} +1 -1
  32. package/dist/shared/{utils-BJWI2OzT.d.mts → utils-m9n-gTFq.d.mts} +1 -1
  33. package/dist/shared/{watch-Cjxo-3u4.mjs → watch-Abdexkk9.mjs} +3 -3
  34. package/package.json +5 -1
@@ -271,12 +271,6 @@ type ImportNameKind = /** `import { x } from "mod"` */
271
271
  'Name' | /** `import * as ns from "mod"` */
272
272
  'NamespaceObject' | /** `import defaultExport from "mod"` */
273
273
  'Default';
274
- /**
275
- * Parse asynchronously.
276
- *
277
- * Note: This function can be slower than `parseSync` due to the overhead of spawning a thread.
278
- */
279
- declare function parse(filename: string, sourceText: string, options?: ParserOptions | undefined | null): Promise<ParseResult>;
280
274
  interface ParserOptions {
281
275
  /** Treat the source text as `js`, `jsx`, `ts`, `tsx` or `dts`. */
282
276
  lang?: 'js' | 'jsx' | 'ts' | 'tsx' | 'dts';
@@ -317,8 +311,6 @@ interface ParserOptions {
317
311
  */
318
312
  showSemanticErrors?: boolean;
319
313
  }
320
- /** Parse synchronously. */
321
- declare function parseSync(filename: string, sourceText: string, options?: ParserOptions | undefined | null): ParseResult;
322
314
  interface Span {
323
315
  start: number;
324
316
  end: number;
@@ -1277,6 +1269,44 @@ declare class BindingMagicString {
1277
1269
  relocate(start: number, end: number, to: number): void;
1278
1270
  indent(indentor?: string | undefined | null): void;
1279
1271
  }
1272
+ declare class BindingNormalizedOptions {
1273
+ get input(): Array<string> | Record<string, string>;
1274
+ get cwd(): string | null;
1275
+ get platform(): 'node' | 'browser' | 'neutral';
1276
+ get shimMissingExports(): boolean;
1277
+ get name(): string | null;
1278
+ get cssEntryFilenames(): string | undefined;
1279
+ get cssChunkFilenames(): string | undefined;
1280
+ get entryFilenames(): string | undefined;
1281
+ get chunkFilenames(): string | undefined;
1282
+ get assetFilenames(): string | undefined;
1283
+ get dir(): string | null;
1284
+ get file(): string | null;
1285
+ get format(): 'es' | 'cjs' | 'iife' | 'umd';
1286
+ get exports(): 'default' | 'named' | 'none' | 'auto';
1287
+ get esModule(): boolean | 'if-default-prop';
1288
+ get inlineDynamicImports(): boolean;
1289
+ get sourcemap(): boolean | 'inline' | 'hidden';
1290
+ get sourcemapBaseUrl(): string | null;
1291
+ get banner(): string | undefined | null | undefined;
1292
+ get footer(): string | undefined | null | undefined;
1293
+ get intro(): string | undefined | null | undefined;
1294
+ get outro(): string | undefined | null | undefined;
1295
+ get externalLiveBindings(): boolean;
1296
+ get extend(): boolean;
1297
+ get globals(): Record<string, string> | undefined;
1298
+ get hashCharacters(): 'base64' | 'base36' | 'hex';
1299
+ get sourcemapDebugIds(): boolean;
1300
+ get polyfillRequire(): boolean;
1301
+ get minify(): false | 'dce-only' | MinifyOptions;
1302
+ get legalComments(): 'none' | 'inline';
1303
+ get preserveModules(): boolean;
1304
+ get preserveModulesRoot(): string | undefined;
1305
+ get virtualDirname(): string;
1306
+ get topLevelVar(): boolean;
1307
+ get minifyInternalExports(): boolean;
1308
+ get context(): string;
1309
+ }
1280
1310
  declare class BindingOutputAsset {
1281
1311
  dropInner(): ExternalMemoryStatus;
1282
1312
  getFileName(): string;
@@ -1344,6 +1374,10 @@ interface BindingAssetSource {
1344
1374
  inner: string | Uint8Array;
1345
1375
  }
1346
1376
  type BindingBuiltinPluginName = 'builtin:esm-external-require' | 'builtin:isolated-declaration' | 'builtin:replace' | 'builtin:vite-alias' | 'builtin:vite-asset' | 'builtin:vite-asset-import-meta-url' | 'builtin:vite-build-import-analysis' | 'builtin:vite-css' | 'builtin:vite-css-post' | 'builtin:vite-dynamic-import-vars' | 'builtin:vite-html' | 'builtin:vite-html-inline-proxy' | 'builtin:vite-import-glob' | 'builtin:vite-json' | 'builtin:vite-load-fallback' | 'builtin:vite-manifest' | 'builtin:vite-module-preload-polyfill' | 'builtin:vite-react-refresh-wrapper' | 'builtin:vite-reporter' | 'builtin:vite-resolve' | 'builtin:vite-transform' | 'builtin:vite-wasm-fallback' | 'builtin:vite-wasm-helper' | 'builtin:vite-web-worker-post';
1377
+ interface BindingBundleState {
1378
+ lastFullBuildFailed: boolean;
1379
+ hasStaleOutput: boolean;
1380
+ }
1347
1381
  interface BindingClientHmrUpdate {
1348
1382
  clientId: string;
1349
1383
  update: BindingHmrUpdate;
@@ -1446,6 +1480,15 @@ interface BindingSourcemap {
1446
1480
  interface BindingTransformHookExtraArgs {
1447
1481
  moduleType: string;
1448
1482
  }
1483
+ interface BindingViteAssetImportMetaUrlPluginConfig {
1484
+ root: string;
1485
+ isLib: boolean;
1486
+ publicDir: string;
1487
+ clientEntry: string;
1488
+ tryFsResolve: (id: string) => string | undefined;
1489
+ assetResolver: (id: string, importer: string) => Promise<string | undefined>;
1490
+ assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
1491
+ }
1449
1492
  interface BindingViteAssetPluginConfig {
1450
1493
  root: string;
1451
1494
  isLib: boolean;
@@ -1499,9 +1542,10 @@ interface BindingViteCssPostPluginConfig {
1499
1542
  urlBase: string;
1500
1543
  decodedBase: string;
1501
1544
  libCssFilename?: string;
1502
- isLegacy?: () => boolean;
1503
- cssMinify?: (css: string) => Promise<string>;
1545
+ isLegacy?: (args: BindingNormalizedOptions) => boolean;
1546
+ cssMinify?: (css: string, inline: boolean) => Promise<string>;
1504
1547
  renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => undefined | string | BindingRenderBuiltUrlRet;
1548
+ cssScopeTo: () => Record<string, readonly [string, string | undefined]>;
1505
1549
  }
1506
1550
  interface BindingViteDynamicImportVarsPluginConfig {
1507
1551
  include?: Array<BindingStringOrRegex>;
@@ -1523,6 +1567,7 @@ interface BindingViteHtmlPluginConfig {
1523
1567
  assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
1524
1568
  renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => undefined | string | BindingRenderBuiltUrlRet;
1525
1569
  transformIndexHtml: (html: string, path: string, filename: string, hook: 'transform' | 'generateBundle', output?: BindingOutputs, chunk?: BindingOutputChunk) => Promise<string>;
1570
+ setModuleSideEffects: (id: string) => void;
1526
1571
  }
1527
1572
  interface BindingViteImportGlobPluginConfig {
1528
1573
  root?: string;
@@ -1538,7 +1583,7 @@ interface BindingViteManifestPluginConfig {
1538
1583
  root: string;
1539
1584
  outPath: string;
1540
1585
  isEnableV2?: boolean;
1541
- isLegacy?: () => boolean;
1586
+ isLegacy?: (args: BindingNormalizedOptions) => boolean;
1542
1587
  cssEntries: () => Record<string, string>;
1543
1588
  }
1544
1589
  interface BindingViteModulePreloadPolyfillPluginConfig {
@@ -1569,6 +1614,7 @@ interface BindingViteResolvePluginConfig {
1569
1614
  external: true | string[];
1570
1615
  noExternal: true | Array<string | RegExp>;
1571
1616
  dedupe: Array<string>;
1617
+ disableCache?: boolean;
1572
1618
  legacyInconsistentCjsInterop?: boolean;
1573
1619
  finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string>;
1574
1620
  finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string>;
@@ -1606,6 +1652,7 @@ interface BindingViteTransformPluginConfig {
1606
1652
  interface BindingViteWasmHelperPluginConfig {
1607
1653
  decodedBase: string;
1608
1654
  }
1655
+ declare function createTokioRuntime(blockingThreads?: number | undefined | null): void;
1609
1656
  interface ExternalMemoryStatus {
1610
1657
  freed: boolean;
1611
1658
  reason?: string;
@@ -1624,4 +1671,4 @@ interface PreRenderedChunk {
1624
1671
  exports: Array<string>;
1625
1672
  }
1626
1673
  //#endregion
1627
- export { ExternalMemoryStatus as A, ResolveResult as B, BindingViteReactRefreshWrapperPluginConfig as C, BindingViteWasmHelperPluginConfig as D, BindingViteTransformPluginConfig as E, MinifyResult as F, isolatedDeclarationSync as G, TransformOptions as H, NapiResolveOptions as I, moduleRunnerTransform as J, minify as K, ParseResult as L, IsolatedDeclarationsResult as M, JsxOptions as N, BindingWatcherBundler as O, MinifyOptions as P, transformSync as Q, ParserOptions as R, BindingViteModulePreloadPolyfillPluginConfig as S, BindingViteResolvePluginConfig as T, TransformResult as U, ResolverFactory as V, isolatedDeclaration as W, parseSync as X, parse as Y, transform as Z, BindingViteHtmlInlineProxyPluginConfig as _, BindingIsolatedDeclarationPluginConfig as a, BindingViteJsonPluginConfig as b, BindingRenderedChunk as c, BindingUrlResolver as d, BindingViteAssetPluginConfig as f, BindingViteDynamicImportVarsPluginConfig as g, BindingViteCssPostPluginConfig as h, BindingHookResolveIdExtraArgs as i, IsolatedDeclarationsOptions as j, BindingWatcherEvent as k, BindingReplacePluginConfig as l, BindingViteCssPluginConfig as m, BindingClientHmrUpdate as n, BindingMagicString as o, BindingViteBuildImportAnalysisPluginConfig as p, minifySync as q, BindingEsmExternalRequirePluginConfig as r, BindingRebuildStrategy as s, BindingBuiltinPluginName as t, BindingTransformHookExtraArgs as u, BindingViteHtmlPluginConfig as v, BindingViteReporterPluginConfig as w, BindingViteManifestPluginConfig as x, BindingViteImportGlobPluginConfig as y, PreRenderedChunk as z };
1674
+ export { transformSync as $, BindingWatcherBundler as A, ParserOptions as B, BindingViteManifestPluginConfig as C, BindingViteResolvePluginConfig as D, BindingViteReporterPluginConfig as E, JsxOptions as F, TransformResult as G, ResolveResult as H, MinifyOptions as I, isolatedDeclarationSync as J, createTokioRuntime as K, MinifyResult as L, ExternalMemoryStatus as M, IsolatedDeclarationsOptions as N, BindingViteTransformPluginConfig as O, IsolatedDeclarationsResult as P, transform as Q, NapiResolveOptions as R, BindingViteJsonPluginConfig as S, BindingViteReactRefreshWrapperPluginConfig as T, ResolverFactory as U, PreRenderedChunk as V, TransformOptions as W, minifySync as X, minify as Y, moduleRunnerTransform as Z, BindingViteCssPostPluginConfig as _, BindingHookResolveIdExtraArgs as a, BindingViteHtmlPluginConfig as b, BindingRebuildStrategy as c, BindingTransformHookExtraArgs as d, BindingUrlResolver as f, BindingViteCssPluginConfig as g, BindingViteBuildImportAnalysisPluginConfig as h, BindingEsmExternalRequirePluginConfig as i, BindingWatcherEvent as j, BindingViteWasmHelperPluginConfig as k, BindingRenderedChunk as l, BindingViteAssetPluginConfig as m, BindingBundleState as n, BindingIsolatedDeclarationPluginConfig as o, BindingViteAssetImportMetaUrlPluginConfig as p, isolatedDeclaration as q, BindingClientHmrUpdate as r, BindingMagicString as s, BindingBuiltinPluginName as t, BindingReplacePluginConfig as u, BindingViteDynamicImportVarsPluginConfig as v, BindingViteModulePreloadPolyfillPluginConfig as w, BindingViteImportGlobPluginConfig as x, BindingViteHtmlInlineProxyPluginConfig as y, ParseResult as z };
@@ -1,7 +1,7 @@
1
1
  import { c as logPluginError, n as error, r as logCycleLoading, t as augmentCodeLocation } from "./logs-CPsamAuj.mjs";
2
2
  import { a as unreachable, i as unimplemented, o as unsupported, t as arraify } from "./misc-5GYLGQ20.mjs";
3
- import { b as normalizeLog, d as __decorate, f as bindingAssetSource, g as MinimalPluginContextImpl, h as PlainObjectLike, i as bindingifyViteHtmlPlugin, l as bindingifySourcemap, m as lazyProp, n as BuiltinPlugin, o as collectChangedBundle, r as bindingifyBuiltInPlugin, s as transformToOutputBundle, t as normalizedStringOrRegex, u as transformRenderedChunk, w as LOG_LEVEL_WARN } from "./normalize-string-or-regex-DvECZN2V.mjs";
4
- import { t as parseAst } from "./parse-ast-index-C_M-Y4oC.mjs";
3
+ import { E as LOG_LEVEL_WARN, S as normalizeLog, _ as PlainObjectLike, a as bindingifyManifestPlugin, c as collectChangedBundle, d as bindingifySourcemap, f as transformRenderedChunk, g as lazyProp, i as bindingifyCSSPostPlugin, l as transformToOutputBundle, m as bindingAssetSource, n as BuiltinPlugin, o as bindingifyViteHtmlPlugin, p as __decorate, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex, v as MinimalPluginContextImpl } from "./normalize-string-or-regex-Bsz_9HAl.mjs";
4
+ import { t as parseAst } from "./parse-ast-index-BOAjpcDq.mjs";
5
5
  import { a as include, c as or, i as id, n as code, o as moduleType, r as exclude, t as and } from "./composable-filters-DZ5ToxRJ.mjs";
6
6
  import { BindingAttachDebugInfo, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects } from "../rolldown-binding.wasi.cjs";
7
7
  import path from "node:path";
@@ -1342,9 +1342,11 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
1342
1342
  const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedOutputPlugins);
1343
1343
  const plugins = rawPlugins.map((plugin) => {
1344
1344
  if ("_parallel" in plugin) return;
1345
- if (plugin instanceof BuiltinPlugin) {
1346
- if (plugin.name === "builtin:vite-html") return bindingifyViteHtmlPlugin(plugin, onLog, logLevel, watchMode);
1347
- return bindingifyBuiltInPlugin(plugin);
1345
+ if (plugin instanceof BuiltinPlugin) switch (plugin.name) {
1346
+ case "builtin:vite-css-post": return bindingifyCSSPostPlugin(plugin, pluginContextData);
1347
+ case "builtin:vite-html": return bindingifyViteHtmlPlugin(plugin, onLog, logLevel, watchMode, pluginContextData);
1348
+ case "builtin:vite-manifest": return bindingifyManifestPlugin(plugin, pluginContextData);
1349
+ default: return bindingifyBuiltInPlugin(plugin);
1348
1350
  }
1349
1351
  return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
1350
1352
  });
@@ -1,4 +1,4 @@
1
- import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-DvECZN2V.mjs";
1
+ import { n as BuiltinPlugin, s as makeBuiltinPluginCallable, t as normalizedStringOrRegex } from "./normalize-string-or-regex-Bsz_9HAl.mjs";
2
2
 
3
3
  //#region src/builtin-plugin/constructors.ts
4
4
  function viteModulePreloadPolyfillPlugin(config) {
@@ -17,9 +17,6 @@ function viteImportGlobPlugin(config) {
17
17
  function viteReporterPlugin(config) {
18
18
  return new BuiltinPlugin("builtin:vite-reporter", config);
19
19
  }
20
- function viteManifestPlugin(config) {
21
- return new BuiltinPlugin("builtin:vite-manifest", config);
22
- }
23
20
  function viteWasmHelperPlugin(config) {
24
21
  return new BuiltinPlugin("builtin:vite-wasm-helper", config);
25
22
  }
@@ -54,12 +51,12 @@ function viteReactRefreshWrapperPlugin(config) {
54
51
  }
55
52
  return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-react-refresh-wrapper", config));
56
53
  }
57
- function viteCSSPostPlugin(config) {
58
- return new BuiltinPlugin("builtin:vite-css-post", config);
59
- }
60
54
  function viteHtmlInlineProxyPlugin(config) {
61
55
  return new BuiltinPlugin("builtin:vite-html-inline-proxy", config);
62
56
  }
57
+ function viteAssetImportMetaUrlPlugin(config) {
58
+ return new BuiltinPlugin("builtin:vite-asset-import-meta-url", config);
59
+ }
63
60
 
64
61
  //#endregion
65
- export { viteWebWorkerPostPlugin as _, viteDynamicImportVarsPlugin as a, viteJsonPlugin as c, viteModulePreloadPolyfillPlugin as d, viteReactRefreshWrapperPlugin as f, viteWasmHelperPlugin as g, viteWasmFallbackPlugin as h, viteCSSPostPlugin as i, viteLoadFallbackPlugin as l, viteResolvePlugin as m, isolatedDeclarationPlugin as n, viteHtmlInlineProxyPlugin as o, viteReporterPlugin as p, viteBuildImportAnalysisPlugin as r, viteImportGlobPlugin as s, esmExternalRequirePlugin as t, viteManifestPlugin as u };
62
+ export { viteDynamicImportVarsPlugin as a, viteJsonPlugin as c, viteReactRefreshWrapperPlugin as d, viteReporterPlugin as f, viteWebWorkerPostPlugin as g, viteWasmHelperPlugin as h, viteBuildImportAnalysisPlugin as i, viteLoadFallbackPlugin as l, viteWasmFallbackPlugin as m, isolatedDeclarationPlugin as n, viteHtmlInlineProxyPlugin as o, viteResolvePlugin as p, viteAssetImportMetaUrlPlugin as r, viteImportGlobPlugin as s, esmExternalRequirePlugin as t, viteModulePreloadPolyfillPlugin as u };
@@ -1,5 +1,5 @@
1
- import { t as BuiltinPlugin, u as StringOrRegExp } from "./utils-BJWI2OzT.mjs";
2
- import { C as BindingViteReactRefreshWrapperPluginConfig, D as BindingViteWasmHelperPluginConfig, S as BindingViteModulePreloadPolyfillPluginConfig, T as BindingViteResolvePluginConfig, _ as BindingViteHtmlInlineProxyPluginConfig, a as BindingIsolatedDeclarationPluginConfig, b as BindingViteJsonPluginConfig, g as BindingViteDynamicImportVarsPluginConfig, h as BindingViteCssPostPluginConfig, p as BindingViteBuildImportAnalysisPluginConfig, r as BindingEsmExternalRequirePluginConfig, w as BindingViteReporterPluginConfig, x as BindingViteManifestPluginConfig, y as BindingViteImportGlobPluginConfig } from "./binding-lSvYApx7.mjs";
1
+ import { t as BuiltinPlugin, u as StringOrRegExp } from "./utils-m9n-gTFq.mjs";
2
+ import { D as BindingViteResolvePluginConfig, E as BindingViteReporterPluginConfig, S as BindingViteJsonPluginConfig, T as BindingViteReactRefreshWrapperPluginConfig, h as BindingViteBuildImportAnalysisPluginConfig, i as BindingEsmExternalRequirePluginConfig, k as BindingViteWasmHelperPluginConfig, o as BindingIsolatedDeclarationPluginConfig, p as BindingViteAssetImportMetaUrlPluginConfig, v as BindingViteDynamicImportVarsPluginConfig, w as BindingViteModulePreloadPolyfillPluginConfig, x as BindingViteImportGlobPluginConfig, y as BindingViteHtmlInlineProxyPluginConfig } from "./binding-CY7Z709f.mjs";
3
3
 
4
4
  //#region src/builtin-plugin/constructors.d.ts
5
5
  declare function viteModulePreloadPolyfillPlugin(config?: BindingViteModulePreloadPolyfillPluginConfig): BuiltinPlugin;
@@ -10,7 +10,6 @@ type DynamicImportVarsPluginConfig = Omit<BindingViteDynamicImportVarsPluginConf
10
10
  declare function viteDynamicImportVarsPlugin(config?: DynamicImportVarsPluginConfig): BuiltinPlugin;
11
11
  declare function viteImportGlobPlugin(config?: BindingViteImportGlobPluginConfig): BuiltinPlugin;
12
12
  declare function viteReporterPlugin(config?: BindingViteReporterPluginConfig): BuiltinPlugin;
13
- declare function viteManifestPlugin(config?: BindingViteManifestPluginConfig): BuiltinPlugin;
14
13
  declare function viteWasmHelperPlugin(config?: BindingViteWasmHelperPluginConfig): BuiltinPlugin;
15
14
  declare function viteWasmFallbackPlugin(): BuiltinPlugin;
16
15
  declare function viteLoadFallbackPlugin(): BuiltinPlugin;
@@ -25,7 +24,7 @@ type ViteReactRefreshWrapperPluginConfig = Omit<BindingViteReactRefreshWrapperPl
25
24
  exclude?: StringOrRegExp | StringOrRegExp[];
26
25
  };
27
26
  declare function viteReactRefreshWrapperPlugin(config: ViteReactRefreshWrapperPluginConfig): BuiltinPlugin;
28
- declare function viteCSSPostPlugin(config?: BindingViteCssPostPluginConfig): BuiltinPlugin;
29
27
  declare function viteHtmlInlineProxyPlugin(config: BindingViteHtmlInlineProxyPluginConfig): BuiltinPlugin;
28
+ declare function viteAssetImportMetaUrlPlugin(config: BindingViteAssetImportMetaUrlPluginConfig): BuiltinPlugin;
30
29
  //#endregion
31
- export { viteWebWorkerPostPlugin as _, viteDynamicImportVarsPlugin as a, viteJsonPlugin as c, viteModulePreloadPolyfillPlugin as d, viteReactRefreshWrapperPlugin as f, viteWasmHelperPlugin as g, viteWasmFallbackPlugin as h, viteCSSPostPlugin as i, viteLoadFallbackPlugin as l, viteResolvePlugin as m, isolatedDeclarationPlugin as n, viteHtmlInlineProxyPlugin as o, viteReporterPlugin as p, viteBuildImportAnalysisPlugin as r, viteImportGlobPlugin as s, esmExternalRequirePlugin as t, viteManifestPlugin as u };
30
+ export { viteDynamicImportVarsPlugin as a, viteJsonPlugin as c, viteReactRefreshWrapperPlugin as d, viteReporterPlugin as f, viteWebWorkerPostPlugin as g, viteWasmHelperPlugin as h, viteBuildImportAnalysisPlugin as i, viteLoadFallbackPlugin as l, viteWasmFallbackPlugin as m, isolatedDeclarationPlugin as n, viteHtmlInlineProxyPlugin as o, viteResolvePlugin as p, viteAssetImportMetaUrlPlugin as r, viteImportGlobPlugin as s, esmExternalRequirePlugin as t, viteModulePreloadPolyfillPlugin as u };
@@ -1,5 +1,5 @@
1
- import { a as MakeAsync, c as NullValue, d as LogLevel, f as LogLevelOption, g as RollupLogWithString, h as RollupLog, l as PartialNull, m as RollupError, n as LoggingFunction, o as MaybeArray, p as LogOrStringHandler, r as LoggingFunctionWithPosition, s as MaybePromise, t as BuiltinPlugin, u as StringOrRegExp } from "./utils-BJWI2OzT.mjs";
2
- import { A as ExternalMemoryStatus, H as TransformOptions$1, N as JsxOptions, O as BindingWatcherBundler, P as MinifyOptions$1, R as ParserOptions, c as BindingRenderedChunk, i as BindingHookResolveIdExtraArgs, k as BindingWatcherEvent, o as BindingMagicString, u as BindingTransformHookExtraArgs, z as PreRenderedChunk } from "./binding-lSvYApx7.mjs";
1
+ import { a as MakeAsync, c as NullValue, d as LogLevel, f as LogLevelOption, g as RollupLogWithString, h as RollupLog, l as PartialNull, m as RollupError, n as LoggingFunction, o as MaybeArray, p as LogOrStringHandler, r as LoggingFunctionWithPosition, s as MaybePromise, t as BuiltinPlugin, u as StringOrRegExp } from "./utils-m9n-gTFq.mjs";
2
+ import { A as BindingWatcherBundler, B as ParserOptions, F as JsxOptions, I as MinifyOptions$1, M as ExternalMemoryStatus, V as PreRenderedChunk, W as TransformOptions$1, a as BindingHookResolveIdExtraArgs, d as BindingTransformHookExtraArgs, j as BindingWatcherEvent, l as BindingRenderedChunk, s as BindingMagicString } from "./binding-CY7Z709f.mjs";
3
3
  import { Program } from "@oxc-project/types";
4
4
  import { TopLevelFilterExpression } from "@rolldown/pluginutils";
5
5
 
@@ -173,7 +173,9 @@ interface GeneratedCodeOptions {
173
173
  * When enabled, generated code will use descriptive variable names that correspond
174
174
  * to the original module names, making it easier to profile and debug the bundled code.
175
175
  *
176
- * @default true when minification is disabled, false when minification is enabled
176
+ * Note: Enabling this option makes the output more difficult to minify effectively.
177
+ *
178
+ * @default false
177
179
  */
178
180
  profilerNames?: boolean;
179
181
  }
@@ -1576,16 +1578,27 @@ interface InputOptions {
1576
1578
  optimization?: OptimizationOptions;
1577
1579
  context?: string;
1578
1580
  /**
1579
- * Allows you to specify where to find the TypeScript configuration file.
1581
+ * Configures TypeScript configuration file resolution and usage.
1582
+ *
1583
+ * ## Options
1584
+ *
1585
+ * - `true`: Auto-discovery mode (similar to Vite). For each module, both resolver and transformer
1586
+ * will find the nearest tsconfig.json. If the tsconfig has `references`, the file extension is
1587
+ * allowed, and the tsconfig's `include`/`exclude` patterns don't match the file, the referenced
1588
+ * tsconfigs will be searched for a match. Falls back to the original tsconfig if no match is found.
1589
+ * - `string`: Path to a specific tsconfig.json file (relative to cwd or absolute path).
1590
+ *
1591
+ * ## What's used from tsconfig
1592
+ *
1593
+ * - **Resolver**: Uses `compilerOptions.paths` and `compilerOptions.baseUrl` for path mapping
1594
+ * - **Transformer**: Uses select compiler options (jsx, decorators, typescript, etc.)
1580
1595
  *
1581
- * You may provide:
1582
- * - a relative path to the configuration file. It will be resolved relative to cwd.
1583
- * - an absolute path to the configuration file.
1596
+ * > [!NOTE]
1597
+ * > Priority: Top-level `transform` options always take precedence over tsconfig settings.
1584
1598
  *
1585
- * When a tsconfig path is specified, the module resolver will respect `compilerOptions.paths` from the specified `tsconfig.json`,
1586
- * and the tsconfig options will be merged with the top-level `transform` options, with the `transform` options taking precedence.
1599
+ * @default undefined (no tsconfig resolution)
1587
1600
  */
1588
- tsconfig?: string;
1601
+ tsconfig?: true | string;
1589
1602
  }
1590
1603
  //#endregion
1591
1604
  //#region src/types/rolldown-options.d.ts
@@ -1,4 +1,4 @@
1
- import { t as rolldown } from "./rolldown-BhV7L6Kg.mjs";
1
+ import { t as rolldown } from "./rolldown-vJGs7rCs.mjs";
2
2
  import path from "node:path";
3
3
  import { readdir } from "node:fs/promises";
4
4
  import { pathToFileURL } from "node:url";
@@ -32,7 +32,7 @@ function getLogHandler(level, code, logger, pluginName, logLevel) {
32
32
 
33
33
  //#endregion
34
34
  //#region package.json
35
- var version = "1.0.0-beta.51";
35
+ var version = "1.0.0-beta.53";
36
36
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
37
37
 
38
38
  //#endregion
@@ -190,7 +190,7 @@ function bindingAssetSource(source) {
190
190
  }
191
191
 
192
192
  //#endregion
193
- //#region \0@oxc-project+runtime@0.98.0/helpers/decorate.js
193
+ //#region \0@oxc-project+runtime@0.101.0/helpers/decorate.js
194
194
  function __decorate(decorators, target, key, desc) {
195
195
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
196
196
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -584,7 +584,36 @@ function bindingifyBuiltInPlugin(plugin) {
584
584
  options: plugin._options
585
585
  };
586
586
  }
587
- function bindingifyViteHtmlPlugin(plugin, onLog, logLevel, watchMode) {
587
+ function bindingifyManifestPlugin(plugin, pluginContextData) {
588
+ const { isOutputOptionsForLegacyChunks, ...options } = plugin._options;
589
+ return {
590
+ __name: plugin.name,
591
+ options: {
592
+ ...options,
593
+ isLegacy: isOutputOptionsForLegacyChunks ? (opts) => {
594
+ return isOutputOptionsForLegacyChunks(pluginContextData.getOutputOptions(opts));
595
+ } : void 0
596
+ }
597
+ };
598
+ }
599
+ function bindingifyCSSPostPlugin(plugin, pluginContextData) {
600
+ const { isOutputOptionsForLegacyChunks, ...options } = plugin._options;
601
+ return {
602
+ __name: plugin.name,
603
+ options: {
604
+ ...options,
605
+ isLegacy: isOutputOptionsForLegacyChunks ? (opts) => {
606
+ return isOutputOptionsForLegacyChunks(pluginContextData.getOutputOptions(opts));
607
+ } : void 0,
608
+ cssScopeTo() {
609
+ const cssScopeTo = {};
610
+ for (const [id, opts] of pluginContextData.moduleOptionMap.entries()) if (opts?.meta.vite?.cssScopeTo) cssScopeTo[id] = opts.meta.vite.cssScopeTo;
611
+ return cssScopeTo;
612
+ }
613
+ }
614
+ };
615
+ }
616
+ function bindingifyViteHtmlPlugin(plugin, onLog, logLevel, watchMode, pluginContextData) {
588
617
  const { preHooks, normalHooks, postHooks, applyHtmlTransforms, ...options } = plugin._options;
589
618
  if (preHooks.length + normalHooks.length + postHooks.length > 0) return {
590
619
  __name: plugin.name,
@@ -605,6 +634,14 @@ function bindingifyViteHtmlPlugin(plugin, onLog, logLevel, watchMode) {
605
634
  case "transform": return await applyHtmlTransforms(html, preHooks, pluginContext, context);
606
635
  case "generateBundle": return await applyHtmlTransforms(html, [...normalHooks, ...postHooks], pluginContext, context);
607
636
  }
637
+ },
638
+ setModuleSideEffects(id) {
639
+ let opts = pluginContextData.getModuleOption(id);
640
+ pluginContextData.updateModuleOption(id, {
641
+ moduleSideEffects: true,
642
+ meta: opts.meta,
643
+ invalidate: true
644
+ });
608
645
  }
609
646
  }
610
647
  };
@@ -626,4 +663,4 @@ function isReadonlyArray(input) {
626
663
  }
627
664
 
628
665
  //#endregion
629
- export { LOG_LEVEL_INFO as C, LOG_LEVEL_ERROR as S, logLevelPriority as T, VERSION as _, makeBuiltinPluginCallable as a, normalizeLog as b, transformToRollupOutput as c, __decorate as d, bindingAssetSource as f, MinimalPluginContextImpl as g, PlainObjectLike as h, bindingifyViteHtmlPlugin as i, bindingifySourcemap as l, lazyProp as m, BuiltinPlugin as n, collectChangedBundle as o, transformAssetSource as p, bindingifyBuiltInPlugin as r, transformToOutputBundle as s, normalizedStringOrRegex as t, transformRenderedChunk as u, description as v, LOG_LEVEL_WARN as w, LOG_LEVEL_DEBUG as x, version as y };
666
+ export { LOG_LEVEL_DEBUG as C, logLevelPriority as D, LOG_LEVEL_WARN as E, normalizeLog as S, LOG_LEVEL_INFO as T, PlainObjectLike as _, bindingifyManifestPlugin as a, description as b, collectChangedBundle as c, bindingifySourcemap as d, transformRenderedChunk as f, lazyProp as g, transformAssetSource as h, bindingifyCSSPostPlugin as i, transformToOutputBundle as l, bindingAssetSource as m, BuiltinPlugin as n, bindingifyViteHtmlPlugin as o, __decorate as p, bindingifyBuiltInPlugin as r, makeBuiltinPluginCallable as s, normalizedStringOrRegex as t, transformToRollupOutput as u, MinimalPluginContextImpl as v, LOG_LEVEL_ERROR as w, version as x, VERSION as y };
@@ -1,7 +1,7 @@
1
1
  import { l as locate, n as error, s as logParseError, u as getCodeFrame } from "./logs-CPsamAuj.mjs";
2
2
  import { parse, parseSync } from "../rolldown-binding.wasi.cjs";
3
3
 
4
- //#region ../../node_modules/.pnpm/oxc-parser@0.98.0/node_modules/oxc-parser/src-js/wrap.js
4
+ //#region ../../node_modules/.pnpm/oxc-parser@0.101.0/node_modules/oxc-parser/src-js/wrap.js
5
5
  function wrap$1(result) {
6
6
  let program, module, comments, errors;
7
7
  return {
@@ -37,10 +37,24 @@ function applyFix(program, fixPath) {
37
37
  } catch {}
38
38
  }
39
39
 
40
+ //#endregion
41
+ //#region src/utils/parse.ts
42
+ /**
43
+ * Parse asynchronously.
44
+ *
45
+ * Note: This function can be slower than `parseSync` due to the overhead of spawning a thread.
46
+ */
47
+ async function parse$1(filename, sourceText, options) {
48
+ return wrap$1(await parse(filename, sourceText, options));
49
+ }
50
+ /** Parse synchronously. */
51
+ function parseSync$1(filename, sourceText, options) {
52
+ return wrap$1(parseSync(filename, sourceText, options));
53
+ }
54
+
40
55
  //#endregion
41
56
  //#region src/parse-ast-index.ts
42
57
  function wrap(result, sourceText) {
43
- result = wrap$1(result);
44
58
  if (result.errors.length > 0) return normalizeParseError(sourceText, result.errors);
45
59
  return result.program;
46
60
  }
@@ -65,17 +79,17 @@ const defaultParserOptions = {
65
79
  preserveParens: false
66
80
  };
67
81
  function parseAst(sourceText, options, filename) {
68
- return wrap(parseSync(filename ?? "file.js", sourceText, {
82
+ return wrap(parseSync$1(filename ?? "file.js", sourceText, {
69
83
  ...defaultParserOptions,
70
84
  ...options
71
85
  }), sourceText);
72
86
  }
73
87
  async function parseAstAsync(sourceText, options, filename) {
74
- return wrap(await parse(filename ?? "file.js", sourceText, {
88
+ return wrap(await parse$1(filename ?? "file.js", sourceText, {
75
89
  ...defaultParserOptions,
76
90
  ...options
77
91
  }), sourceText);
78
92
  }
79
93
 
80
94
  //#endregion
81
- export { parseAstAsync as n, parseAst as t };
95
+ export { parseSync$1 as i, parseAstAsync as n, parse$1 as r, parseAst as t };