@rolldown/browser 1.0.0-beta.18 → 1.0.0-beta.20

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 (39) hide show
  1. package/dist/cli.cjs +5 -5
  2. package/dist/cli.mjs +5 -5
  3. package/dist/config.cjs +3 -3
  4. package/dist/config.d.cts +2 -2
  5. package/dist/config.d.mts +2 -2
  6. package/dist/config.mjs +3 -3
  7. package/dist/experimental-index.browser.mjs +1 -3
  8. package/dist/experimental-index.cjs +2 -4
  9. package/dist/experimental-index.d.cts +2 -4
  10. package/dist/experimental-index.d.mts +2 -4
  11. package/dist/experimental-index.mjs +2 -4
  12. package/dist/filter-index.d.cts +2 -2
  13. package/dist/filter-index.d.mts +2 -2
  14. package/dist/index.browser.mjs +1 -1
  15. package/dist/index.cjs +2 -2
  16. package/dist/index.d.cts +2 -2
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.mjs +2 -2
  19. package/dist/parallel-plugin-worker.cjs +2 -2
  20. package/dist/parallel-plugin-worker.mjs +2 -2
  21. package/dist/parallel-plugin.d.cts +2 -2
  22. package/dist/parallel-plugin.d.mts +2 -2
  23. package/dist/parse-ast-index.cjs +1 -1
  24. package/dist/parse-ast-index.d.cts +1 -1
  25. package/dist/parse-ast-index.d.mts +1 -1
  26. package/dist/parse-ast-index.mjs +1 -1
  27. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  28. package/dist/shared/{binding-D__94uwg.d.cts → binding-5O9lFYtz.d.mts} +8 -0
  29. package/dist/shared/{binding-DwMf_OTa.d.mts → binding-BvKFOCZr.d.cts} +8 -0
  30. package/dist/shared/{define-config-CXjwrGWr.d.cts → define-config-BOD4oRSZ.d.cts} +101 -8
  31. package/dist/shared/{define-config-DaQ-joKc.d.mts → define-config-BkOPk1xB.d.mts} +101 -8
  32. package/dist/shared/{load-config-BwSSRqdO.mjs → load-config-DM-oJ57C.mjs} +1 -1
  33. package/dist/shared/{load-config-CbF4BrKX.cjs → load-config-DqsT2fin.cjs} +1 -1
  34. package/dist/shared/{parse-ast-index-BHw-MFh6.mjs → parse-ast-index-BzdtcWzA.mjs} +3 -3
  35. package/dist/shared/{parse-ast-index-DQhRVBEm.cjs → parse-ast-index-CGTVCgvx.cjs} +3 -3
  36. package/dist/shared/{src-D1ozKBtx.mjs → src-C55LDCFJ.mjs} +13 -8
  37. package/dist/shared/{src-BP3CtG4Q.cjs → src-DamX4spE.cjs} +13 -8
  38. package/dist/{src-CEdhd_Z1.js → src-ghPUGklU.js} +15 -10
  39. package/package.json +2 -2
package/dist/cli.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  const require_chunk = require('./shared/chunk-DDkG_k5U.cjs');
2
- const require_src = require('./shared/src-BP3CtG4Q.cjs');
2
+ const require_src = require('./shared/src-DamX4spE.cjs');
3
3
  const require_dist = require('./shared/dist-BMVjvV-v.cjs');
4
- require('./shared/parse-ast-index-DQhRVBEm.cjs');
5
- const require_load_config = require('./shared/load-config-CbF4BrKX.cjs');
4
+ require('./shared/parse-ast-index-CGTVCgvx.cjs');
5
+ const require_load_config = require('./shared/load-config-DqsT2fin.cjs');
6
6
  const node_path = require_chunk.__toESM(require("node:path"));
7
7
  const node_process = require_chunk.__toESM(require("node:process"));
8
8
  const node_util = require_chunk.__toESM(require("node:util"));
@@ -1423,8 +1423,8 @@ const process$2 = globalThis.process;
1423
1423
  const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
1424
1424
 
1425
1425
  //#endregion
1426
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.73.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
1427
- var require_usingCtx = require_chunk.__commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.73.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
1426
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.75.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
1427
+ var require_usingCtx = require_chunk.__commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.75.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
1428
1428
  function _usingCtx() {
1429
1429
  var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$2, e$1) {
1430
1430
  var n$2 = Error();
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { __commonJS, __toESM, ansis_default, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "./shared/src-D1ozKBtx.mjs";
1
+ import { __commonJS, __toESM, ansis_default, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "./shared/src-C55LDCFJ.mjs";
2
2
  import { arraify } from "./shared/dist-BoWaIc-K.mjs";
3
- import "./shared/parse-ast-index-BHw-MFh6.mjs";
4
- import { loadConfig } from "./shared/load-config-BwSSRqdO.mjs";
3
+ import "./shared/parse-ast-index-BzdtcWzA.mjs";
4
+ import { loadConfig } from "./shared/load-config-DM-oJ57C.mjs";
5
5
  import path, { sep } from "node:path";
6
6
  import process$1 from "node:process";
7
7
  import { formatWithOptions, parseArgs } from "node:util";
@@ -1422,8 +1422,8 @@ const process$2 = globalThis.process;
1422
1422
  const { onExit, load, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
1423
1423
 
1424
1424
  //#endregion
1425
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.73.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
1426
- var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.73.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
1425
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.75.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
1426
+ var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.75.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
1427
1427
  function _usingCtx() {
1428
1428
  var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$2, e$1) {
1429
1429
  var n$2 = Error();
package/dist/config.cjs CHANGED
@@ -1,7 +1,7 @@
1
- const require_src = require('./shared/src-BP3CtG4Q.cjs');
1
+ const require_src = require('./shared/src-DamX4spE.cjs');
2
2
  require('./shared/dist-BMVjvV-v.cjs');
3
- require('./shared/parse-ast-index-DQhRVBEm.cjs');
4
- const require_load_config = require('./shared/load-config-CbF4BrKX.cjs');
3
+ require('./shared/parse-ast-index-CGTVCgvx.cjs');
4
+ const require_load_config = require('./shared/load-config-DqsT2fin.cjs');
5
5
 
6
6
  //#region src/config.ts
7
7
  const VERSION = require_src.version;
package/dist/config.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import "./shared/binding-D__94uwg.cjs";
2
- import { ConfigExport, defineConfig } from "./shared/define-config-CXjwrGWr.cjs";
1
+ import "./shared/binding-BvKFOCZr.cjs";
2
+ import { ConfigExport, defineConfig } from "./shared/define-config-BOD4oRSZ.cjs";
3
3
 
4
4
  //#region src/utils/load-config.d.ts
5
5
  declare function loadConfig(configPath: string): Promise<ConfigExport>;
package/dist/config.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import "./shared/binding-DwMf_OTa.mjs";
2
- import { ConfigExport, defineConfig } from "./shared/define-config-DaQ-joKc.mjs";
1
+ import "./shared/binding-5O9lFYtz.mjs";
2
+ import { ConfigExport, defineConfig } from "./shared/define-config-BkOPk1xB.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 { defineConfig, version } from "./shared/src-D1ozKBtx.mjs";
1
+ import { defineConfig, version } from "./shared/src-C55LDCFJ.mjs";
2
2
  import "./shared/dist-BoWaIc-K.mjs";
3
- import "./shared/parse-ast-index-BHw-MFh6.mjs";
4
- import { loadConfig } from "./shared/load-config-BwSSRqdO.mjs";
3
+ import "./shared/parse-ast-index-BzdtcWzA.mjs";
4
+ import { loadConfig } from "./shared/load-config-DM-oJ57C.mjs";
5
5
 
6
6
  //#region src/config.ts
7
7
  const VERSION = version;
@@ -1,4 +1,4 @@
1
- import { BuiltinPlugin, PluginDriver, assetPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundlerImpl, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./src-CEdhd_Z1.js";
1
+ import { BuiltinPlugin, PluginDriver, assetPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundlerImpl, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./src-ghPUGklU.js";
2
2
  import { BindingBundler, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi-browser.js";
3
3
 
4
4
  //#region src/api/experimental.ts
@@ -37,7 +37,6 @@ function aliasPlugin(config) {
37
37
  * ```js
38
38
  * replacePlugin({
39
39
  * 'process.env.NODE_ENV': JSON.stringify('production'),
40
- * __buildDate__: () => JSON.stringify(new Date()),
41
40
  * __buildVersion: 15
42
41
  * })
43
42
  * ```
@@ -46,7 +45,6 @@ function aliasPlugin(config) {
46
45
  * ```js
47
46
  * replacePlugin({
48
47
  * 'process.env.NODE_ENV': JSON.stringify('production'),
49
- * __buildDate__: () => JSON.stringify(new Date()),
50
48
  * __buildVersion: 15
51
49
  * }, {
52
50
  * preventAssignment: false,
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('./shared/chunk-DDkG_k5U.cjs');
2
- const require_src = require('./shared/src-BP3CtG4Q.cjs');
2
+ const require_src = require('./shared/src-DamX4spE.cjs');
3
3
  require('./shared/dist-BMVjvV-v.cjs');
4
- require('./shared/parse-ast-index-DQhRVBEm.cjs');
4
+ require('./shared/parse-ast-index-CGTVCgvx.cjs');
5
5
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
6
6
  const node_url = require_chunk.__toESM(require("node:url"));
7
7
 
@@ -46,7 +46,6 @@ function aliasPlugin(config) {
46
46
  * ```js
47
47
  * replacePlugin({
48
48
  * 'process.env.NODE_ENV': JSON.stringify('production'),
49
- * __buildDate__: () => JSON.stringify(new Date()),
50
49
  * __buildVersion: 15
51
50
  * })
52
51
  * ```
@@ -55,7 +54,6 @@ function aliasPlugin(config) {
55
54
  * ```js
56
55
  * replacePlugin({
57
56
  * 'process.env.NODE_ENV': JSON.stringify('production'),
58
- * __buildDate__: () => JSON.stringify(new Date()),
59
57
  * __buildVersion: 15
60
58
  * }, {
61
59
  * preventAssignment: false,
@@ -1,5 +1,5 @@
1
- import { BindingReplacePluginConfig, BindingTransformPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-D__94uwg.cjs";
2
- import { BuiltinPlugin, InputOptions, RolldownPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./shared/define-config-CXjwrGWr.cjs";
1
+ import { BindingReplacePluginConfig, BindingTransformPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-BvKFOCZr.cjs";
2
+ import { BuiltinPlugin, InputOptions, RolldownPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./shared/define-config-BOD4oRSZ.cjs";
3
3
 
4
4
  //#region src/api/experimental.d.ts
5
5
 
@@ -33,7 +33,6 @@ declare function aliasPlugin(config: AliasPluginConfig): BuiltinPlugin;
33
33
  * ```js
34
34
  * replacePlugin({
35
35
  * 'process.env.NODE_ENV': JSON.stringify('production'),
36
- * __buildDate__: () => JSON.stringify(new Date()),
37
36
  * __buildVersion: 15
38
37
  * })
39
38
  * ```
@@ -42,7 +41,6 @@ declare function aliasPlugin(config: AliasPluginConfig): BuiltinPlugin;
42
41
  * ```js
43
42
  * replacePlugin({
44
43
  * 'process.env.NODE_ENV': JSON.stringify('production'),
45
- * __buildDate__: () => JSON.stringify(new Date()),
46
44
  * __buildVersion: 15
47
45
  * }, {
48
46
  * preventAssignment: false,
@@ -1,5 +1,5 @@
1
- import { BindingReplacePluginConfig, BindingTransformPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-DwMf_OTa.mjs";
2
- import { BuiltinPlugin, InputOptions, RolldownPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./shared/define-config-DaQ-joKc.mjs";
1
+ import { BindingReplacePluginConfig, BindingTransformPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-5O9lFYtz.mjs";
2
+ import { BuiltinPlugin, InputOptions, RolldownPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./shared/define-config-BkOPk1xB.mjs";
3
3
 
4
4
  //#region src/api/experimental.d.ts
5
5
 
@@ -33,7 +33,6 @@ declare function aliasPlugin(config: AliasPluginConfig): BuiltinPlugin;
33
33
  * ```js
34
34
  * replacePlugin({
35
35
  * 'process.env.NODE_ENV': JSON.stringify('production'),
36
- * __buildDate__: () => JSON.stringify(new Date()),
37
36
  * __buildVersion: 15
38
37
  * })
39
38
  * ```
@@ -42,7 +41,6 @@ declare function aliasPlugin(config: AliasPluginConfig): BuiltinPlugin;
42
41
  * ```js
43
42
  * replacePlugin({
44
43
  * 'process.env.NODE_ENV': JSON.stringify('production'),
45
- * __buildDate__: () => JSON.stringify(new Date()),
46
44
  * __buildVersion: 15
47
45
  * }, {
48
46
  * preventAssignment: false,
@@ -1,6 +1,6 @@
1
- import { BuiltinPlugin, PluginDriver, assetPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundlerImpl, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./shared/src-D1ozKBtx.mjs";
1
+ import { BuiltinPlugin, PluginDriver, assetPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundlerImpl, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./shared/src-C55LDCFJ.mjs";
2
2
  import "./shared/dist-BoWaIc-K.mjs";
3
- import "./shared/parse-ast-index-BHw-MFh6.mjs";
3
+ import "./shared/parse-ast-index-BzdtcWzA.mjs";
4
4
  import { BindingBundler, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
5
5
  import { pathToFileURL } from "node:url";
6
6
 
@@ -45,7 +45,6 @@ function aliasPlugin(config) {
45
45
  * ```js
46
46
  * replacePlugin({
47
47
  * 'process.env.NODE_ENV': JSON.stringify('production'),
48
- * __buildDate__: () => JSON.stringify(new Date()),
49
48
  * __buildVersion: 15
50
49
  * })
51
50
  * ```
@@ -54,7 +53,6 @@ function aliasPlugin(config) {
54
53
  * ```js
55
54
  * replacePlugin({
56
55
  * 'process.env.NODE_ENV': JSON.stringify('production'),
57
- * __buildDate__: () => JSON.stringify(new Date()),
58
56
  * __buildVersion: 15
59
57
  * }, {
60
58
  * preventAssignment: false,
@@ -1,4 +1,4 @@
1
- import "./shared/binding-D__94uwg.cjs";
2
- import { withFilter } from "./shared/define-config-CXjwrGWr.cjs";
1
+ import "./shared/binding-BvKFOCZr.cjs";
2
+ import { withFilter } from "./shared/define-config-BOD4oRSZ.cjs";
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,4 +1,4 @@
1
- import "./shared/binding-DwMf_OTa.mjs";
2
- import { withFilter } from "./shared/define-config-DaQ-joKc.mjs";
1
+ import "./shared/binding-5O9lFYtz.mjs";
2
+ import { withFilter } from "./shared/define-config-BkOPk1xB.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 { VERSION, build, defineConfig, rolldown, watch } from "./src-CEdhd_Z1.js";
1
+ import { VERSION, build, defineConfig, rolldown, watch } from "./src-ghPUGklU.js";
2
2
 
3
3
  export { VERSION, build, defineConfig, rolldown, watch };
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
- const require_src = require('./shared/src-BP3CtG4Q.cjs');
1
+ const require_src = require('./shared/src-DamX4spE.cjs');
2
2
  require('./shared/dist-BMVjvV-v.cjs');
3
- require('./shared/parse-ast-index-DQhRVBEm.cjs');
3
+ require('./shared/parse-ast-index-CGTVCgvx.cjs');
4
4
 
5
5
  exports.VERSION = require_src.VERSION;
6
6
  exports.build = require_src.build;
package/dist/index.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { PreRenderedChunk } from "./shared/binding-D__94uwg.cjs";
2
- import { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch } from "./shared/define-config-CXjwrGWr.cjs";
1
+ import { PreRenderedChunk } from "./shared/binding-BvKFOCZr.cjs";
2
+ import { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch } from "./shared/define-config-BOD4oRSZ.cjs";
3
3
  export { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, 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.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { PreRenderedChunk } from "./shared/binding-DwMf_OTa.mjs";
2
- import { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch } from "./shared/define-config-DaQ-joKc.mjs";
1
+ import { PreRenderedChunk } from "./shared/binding-5O9lFYtz.mjs";
2
+ import { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch } from "./shared/define-config-BkOPk1xB.mjs";
3
3
  export { AddonFunction, AsyncPluginHooks, BuildOptions, ChunkFileNamesFunction, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, 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 { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-D1ozKBtx.mjs";
1
+ import { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-C55LDCFJ.mjs";
2
2
  import "./shared/dist-BoWaIc-K.mjs";
3
- import "./shared/parse-ast-index-BHw-MFh6.mjs";
3
+ import "./shared/parse-ast-index-BzdtcWzA.mjs";
4
4
 
5
5
  export { VERSION, build, defineConfig, rolldown, watch };
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('./shared/chunk-DDkG_k5U.cjs');
2
- const require_src = require('./shared/src-BP3CtG4Q.cjs');
2
+ const require_src = require('./shared/src-DamX4spE.cjs');
3
3
  require('./shared/dist-BMVjvV-v.cjs');
4
- require('./shared/parse-ast-index-DQhRVBEm.cjs');
4
+ require('./shared/parse-ast-index-CGTVCgvx.cjs');
5
5
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
6
6
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
7
7
 
@@ -1,6 +1,6 @@
1
- import { PluginContextData, bindingifyPlugin } from "./shared/src-D1ozKBtx.mjs";
1
+ import { PluginContextData, bindingifyPlugin } from "./shared/src-C55LDCFJ.mjs";
2
2
  import "./shared/dist-BoWaIc-K.mjs";
3
- import "./shared/parse-ast-index-BHw-MFh6.mjs";
3
+ import "./shared/parse-ast-index-BzdtcWzA.mjs";
4
4
  import { registerPlugins } from "./rolldown-binding.wasi.cjs";
5
5
  import { parentPort, workerData } from "node:worker_threads";
6
6
 
@@ -1,5 +1,5 @@
1
- import "./shared/binding-D__94uwg.cjs";
2
- import { MaybePromise, Plugin } from "./shared/define-config-CXjwrGWr.cjs";
1
+ import "./shared/binding-BvKFOCZr.cjs";
2
+ import { MaybePromise, Plugin } from "./shared/define-config-BOD4oRSZ.cjs";
3
3
 
4
4
  //#region src/plugin/parallel-plugin-implementation.d.ts
5
5
  type ParallelPluginImplementation = Plugin;
@@ -1,5 +1,5 @@
1
- import "./shared/binding-DwMf_OTa.mjs";
2
- import { MaybePromise, Plugin } from "./shared/define-config-DaQ-joKc.mjs";
1
+ import "./shared/binding-5O9lFYtz.mjs";
2
+ import { MaybePromise, Plugin } from "./shared/define-config-BkOPk1xB.mjs";
3
3
 
4
4
  //#region src/plugin/parallel-plugin-implementation.d.ts
5
5
  type ParallelPluginImplementation = Plugin;
@@ -1,4 +1,4 @@
1
- const require_parse_ast_index = require('./shared/parse-ast-index-DQhRVBEm.cjs');
1
+ const require_parse_ast_index = require('./shared/parse-ast-index-CGTVCgvx.cjs');
2
2
 
3
3
  exports.parseAst = require_parse_ast_index.parseAst;
4
4
  exports.parseAstAsync = require_parse_ast_index.parseAstAsync;
@@ -1,4 +1,4 @@
1
- import { ParseResult, ParserOptions } from "./shared/binding-D__94uwg.cjs";
1
+ import { ParseResult, ParserOptions } from "./shared/binding-BvKFOCZr.cjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
 
4
4
  //#region src/parse-ast-index.d.ts
@@ -1,4 +1,4 @@
1
- import { ParseResult, ParserOptions } from "./shared/binding-DwMf_OTa.mjs";
1
+ import { ParseResult, ParserOptions } from "./shared/binding-5O9lFYtz.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 { parseAst, parseAstAsync } from "./shared/parse-ast-index-BHw-MFh6.mjs";
1
+ import { parseAst, parseAstAsync } from "./shared/parse-ast-index-BzdtcWzA.mjs";
2
2
 
3
3
  export { parseAst, parseAstAsync };
@@ -125,6 +125,14 @@ interface ParserOptions {
125
125
  * The type of the file is determined from `lang` option, or extension of provided `filename`.
126
126
  */
127
127
  astType?: 'js' | 'ts';
128
+ /**
129
+ * Controls whether the `range` property is included on AST nodes.
130
+ * The `range` property is a `[number, number]` which indicates the start/end offsets
131
+ * of the node in the file contents.
132
+ *
133
+ * @default false
134
+ */
135
+ range?: boolean;
128
136
  /**
129
137
  * Emit `ParenthesizedExpression` and `TSParenthesizedType` in AST.
130
138
  *
@@ -125,6 +125,14 @@ interface ParserOptions {
125
125
  * The type of the file is determined from `lang` option, or extension of provided `filename`.
126
126
  */
127
127
  astType?: 'js' | 'ts';
128
+ /**
129
+ * Controls whether the `range` property is included on AST nodes.
130
+ * The `range` property is a `[number, number]` which indicates the start/end offsets
131
+ * of the node in the file contents.
132
+ *
133
+ * @default false
134
+ */
135
+ range?: boolean;
128
136
  /**
129
137
  * Emit `ParenthesizedExpression` and `TSParenthesizedType` in AST.
130
138
  *
@@ -1,4 +1,4 @@
1
- import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-D__94uwg.cjs";
1
+ import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-BvKFOCZr.cjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
  import { TopLevelFilterExpression } from "@rolldown/pluginutils";
4
4
 
@@ -170,6 +170,51 @@ interface OutputOptions {
170
170
  externalLiveBindings?: boolean;
171
171
  inlineDynamicImports?: boolean;
172
172
  /**
173
+ * - Type: `((moduleId: string) => string | NullValue)`
174
+ * - Object form is not supported.
175
+ *
176
+ * :::warning
177
+ * - This option is deprecated. Please use `advancedChunks` instead.
178
+ * - If `manualChunks` and `advancedChunks` are both specified, `manualChunks` option will be ignored.
179
+ * :::
180
+ *
181
+ * You could use this option for migration purpose. Under the hood,
182
+ *
183
+ * ```js
184
+ * {
185
+ * manualChunks: (moduleId, meta) => {
186
+ * if (moduleId.includes('node_modules')) {
187
+ * return 'vendor';
188
+ * }
189
+ * return null;
190
+ * }
191
+ * }
192
+ * ```
193
+ *
194
+ * will be transformed to
195
+ *
196
+ * ```js
197
+ * {
198
+ * advancedChunks: {
199
+ * groups: [
200
+ * {
201
+ * name(moduleId) {
202
+ * if (moduleId.includes('node_modules')) {
203
+ * return 'vendor';
204
+ * }
205
+ * return null;
206
+ * },
207
+ * },
208
+ * ],
209
+ * }
210
+ * }
211
+ *
212
+ * ```
213
+ *
214
+ * @deprecated Please use `advancedChunks` instead.
215
+ */
216
+ manualChunks?: (moduleId: string, meta: {}) => string | NullValue;
217
+ /**
173
218
  * Allows you to do manual chunking. For deeper understanding, please refer to the in-depth [documentation](https://rolldown.rs/guide/in-depth/advanced-chunks).
174
219
  */
175
220
  advancedChunks?: {
@@ -208,7 +253,7 @@ interface OutputOptions {
208
253
  */
209
254
  groups?: {
210
255
  /**
211
- * - Type: `string`
256
+ * - Type: `string | ((moduleId: string) => string | NullValue)`
212
257
  *
213
258
  * Name of the group. It will be also used as the name of the chunk and replaced the `[name]` placeholder in the `chunkFileNames` option.
214
259
  *
@@ -229,8 +274,37 @@ interface OutputOptions {
229
274
  * });
230
275
  * ```
231
276
  * will create a chunk named `libs-[hash].js` in the end.
277
+ *
278
+ * It's ok to have the same name for different groups. Rolldown will deduplicate the chunk names if necessary.
279
+ *
280
+ * # Dynamic `name()`
281
+ *
282
+ * If `name` is a function, it will be called with the module id as the argument. The function should return a string or `null`. If it returns `null`, the module will be ignored by this group.
283
+ *
284
+ * Notice, each returned new name will be treated as a separate group.
285
+ *
286
+ * For example,
287
+ *
288
+ * ```js
289
+ * import { defineConfig } from 'rolldown';
290
+ *
291
+ * export default defineConfig({
292
+ * advancedChunks: {
293
+ * groups: [
294
+ * {
295
+ * name: (moduleId) => moduleId.includes('node_modules') ? 'libs' : 'app',
296
+ * minSize: 100 * 1024,
297
+ * },
298
+ * ],
299
+ * },
300
+ * });
301
+ * ```
302
+ *
303
+ * :::warning
304
+ * Constraints like `minSize`, `maxSize`, etc. are applied separately for different names returned by the function.
305
+ * :::
232
306
  */
233
- name: string;
307
+ name: string | ((moduleId: string) => string | NullValue);
234
308
  /**
235
309
  * - Type: `string | RegExp | ((id: string) => boolean | undefined | void);`
236
310
  *
@@ -240,6 +314,12 @@ interface OutputOptions {
240
314
  * - If `test` is a regular expression, the module whose id matches the regular expression will be captured.
241
315
  * - If `test` is a function, modules for which `test(id)` returns `true` will be captured.
242
316
  * - If `test` is empty, any module will be considered as matched.
317
+ *
318
+ * :::warning
319
+ * When using regular expression, it's recommended to use `[\\/]` to match the path separator instead of `/` to avoid potential issues on Windows.
320
+ * - ✅ Recommended: `/node_modules[\\/]react/`
321
+ * - ❌ Not recommended: `/node_modules/react/`
322
+ * :::
243
323
  */
244
324
  test?: StringOrRegExp | ((id: string) => boolean | undefined | void);
245
325
  /**
@@ -260,7 +340,7 @@ interface OutputOptions {
260
340
  * groups: [
261
341
  * {
262
342
  * name: 'react',
263
- * test: /node_modules\/react/,
343
+ * test: /node_modules[\\/]react/,
264
344
  * priority: 1,
265
345
  * },
266
346
  * {
@@ -279,7 +359,7 @@ interface OutputOptions {
279
359
  * - Type: `number`
280
360
  * - Default: `0`
281
361
  *
282
- * Minimum size of the desired chunk. If the accumulated size of the captured modules by this group is smaller than this value, it will be ignored. Modules in this group will fall back to the `automatic chunking` if they are not captured by any other group.
362
+ * Minimum size in bytes of the desired chunk. If the accumulated size of the captured modules by this group is smaller than this value, it will be ignored. Modules in this group will fall back to the `automatic chunking` if they are not captured by any other group.
283
363
  */
284
364
  minSize?: number;
285
365
  /**
@@ -293,21 +373,21 @@ interface OutputOptions {
293
373
  * - Type: `number`
294
374
  * - Default: `Infinity`
295
375
  *
296
- * If the accumulated size of the captured modules by this group is larger than this value, this group will be split into multiple groups that each has size close to this value.
376
+ * If the accumulated size in bytes of the captured modules by this group is larger than this value, this group will be split into multiple groups that each has size close to this value.
297
377
  */
298
378
  maxSize?: number;
299
379
  /**
300
380
  * - Type: `number`
301
381
  * - Default: `Infinity`
302
382
  *
303
- * Controls a module could only be captured if its size is smaller or equal than this value.
383
+ * Controls a module could only be captured if its size in bytes is smaller or equal than this value.
304
384
  */
305
385
  maxModuleSize?: number;
306
386
  /**
307
387
  * - Type: `number`
308
388
  * - Default: `0`
309
389
  *
310
- * Controls a module could only be captured if its size is larger or equal than this value.
390
+ * Controls a module could only be captured if its size in bytes is larger or equal than this value.
311
391
  */
312
392
  minModuleSize?: number;
313
393
  }[];
@@ -980,6 +1060,19 @@ interface InputOptions {
980
1060
  viteMode?: boolean;
981
1061
  resolveNewUrlToAsset?: boolean;
982
1062
  hmr?: HmrOptions;
1063
+ /**
1064
+ * Attach debug information to the output bundle.
1065
+ *
1066
+ * - Type: `'none' | 'simple' | 'full'`
1067
+ * - Default: `'simple'`
1068
+ *
1069
+ * - `none`: No debug information is attached.
1070
+ * - `simple`: Attach comments indicating which files the bundled code comes from. These comments could be removed by the minifier.
1071
+ * - `full`: Attach detailed debug information to the output bundle. These comments are using legal comment syntax, so they won't be removed by the minifier.
1072
+ *
1073
+ * > [!WARNING]
1074
+ * > You shouldn't use `full` in the production build.
1075
+ */
983
1076
  attachDebugInfo?: AttachDebugOptions;
984
1077
  };
985
1078
  /**
@@ -1,4 +1,4 @@
1
- import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-DwMf_OTa.mjs";
1
+ import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrOutputPatch, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingModulePreloadPolyfillPluginConfig, BindingRemote, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-5O9lFYtz.mjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
  import { TopLevelFilterExpression } from "@rolldown/pluginutils";
4
4
 
@@ -170,6 +170,51 @@ interface OutputOptions {
170
170
  externalLiveBindings?: boolean;
171
171
  inlineDynamicImports?: boolean;
172
172
  /**
173
+ * - Type: `((moduleId: string) => string | NullValue)`
174
+ * - Object form is not supported.
175
+ *
176
+ * :::warning
177
+ * - This option is deprecated. Please use `advancedChunks` instead.
178
+ * - If `manualChunks` and `advancedChunks` are both specified, `manualChunks` option will be ignored.
179
+ * :::
180
+ *
181
+ * You could use this option for migration purpose. Under the hood,
182
+ *
183
+ * ```js
184
+ * {
185
+ * manualChunks: (moduleId, meta) => {
186
+ * if (moduleId.includes('node_modules')) {
187
+ * return 'vendor';
188
+ * }
189
+ * return null;
190
+ * }
191
+ * }
192
+ * ```
193
+ *
194
+ * will be transformed to
195
+ *
196
+ * ```js
197
+ * {
198
+ * advancedChunks: {
199
+ * groups: [
200
+ * {
201
+ * name(moduleId) {
202
+ * if (moduleId.includes('node_modules')) {
203
+ * return 'vendor';
204
+ * }
205
+ * return null;
206
+ * },
207
+ * },
208
+ * ],
209
+ * }
210
+ * }
211
+ *
212
+ * ```
213
+ *
214
+ * @deprecated Please use `advancedChunks` instead.
215
+ */
216
+ manualChunks?: (moduleId: string, meta: {}) => string | NullValue;
217
+ /**
173
218
  * Allows you to do manual chunking. For deeper understanding, please refer to the in-depth [documentation](https://rolldown.rs/guide/in-depth/advanced-chunks).
174
219
  */
175
220
  advancedChunks?: {
@@ -208,7 +253,7 @@ interface OutputOptions {
208
253
  */
209
254
  groups?: {
210
255
  /**
211
- * - Type: `string`
256
+ * - Type: `string | ((moduleId: string) => string | NullValue)`
212
257
  *
213
258
  * Name of the group. It will be also used as the name of the chunk and replaced the `[name]` placeholder in the `chunkFileNames` option.
214
259
  *
@@ -229,8 +274,37 @@ interface OutputOptions {
229
274
  * });
230
275
  * ```
231
276
  * will create a chunk named `libs-[hash].js` in the end.
277
+ *
278
+ * It's ok to have the same name for different groups. Rolldown will deduplicate the chunk names if necessary.
279
+ *
280
+ * # Dynamic `name()`
281
+ *
282
+ * If `name` is a function, it will be called with the module id as the argument. The function should return a string or `null`. If it returns `null`, the module will be ignored by this group.
283
+ *
284
+ * Notice, each returned new name will be treated as a separate group.
285
+ *
286
+ * For example,
287
+ *
288
+ * ```js
289
+ * import { defineConfig } from 'rolldown';
290
+ *
291
+ * export default defineConfig({
292
+ * advancedChunks: {
293
+ * groups: [
294
+ * {
295
+ * name: (moduleId) => moduleId.includes('node_modules') ? 'libs' : 'app',
296
+ * minSize: 100 * 1024,
297
+ * },
298
+ * ],
299
+ * },
300
+ * });
301
+ * ```
302
+ *
303
+ * :::warning
304
+ * Constraints like `minSize`, `maxSize`, etc. are applied separately for different names returned by the function.
305
+ * :::
232
306
  */
233
- name: string;
307
+ name: string | ((moduleId: string) => string | NullValue);
234
308
  /**
235
309
  * - Type: `string | RegExp | ((id: string) => boolean | undefined | void);`
236
310
  *
@@ -240,6 +314,12 @@ interface OutputOptions {
240
314
  * - If `test` is a regular expression, the module whose id matches the regular expression will be captured.
241
315
  * - If `test` is a function, modules for which `test(id)` returns `true` will be captured.
242
316
  * - If `test` is empty, any module will be considered as matched.
317
+ *
318
+ * :::warning
319
+ * When using regular expression, it's recommended to use `[\\/]` to match the path separator instead of `/` to avoid potential issues on Windows.
320
+ * - ✅ Recommended: `/node_modules[\\/]react/`
321
+ * - ❌ Not recommended: `/node_modules/react/`
322
+ * :::
243
323
  */
244
324
  test?: StringOrRegExp | ((id: string) => boolean | undefined | void);
245
325
  /**
@@ -260,7 +340,7 @@ interface OutputOptions {
260
340
  * groups: [
261
341
  * {
262
342
  * name: 'react',
263
- * test: /node_modules\/react/,
343
+ * test: /node_modules[\\/]react/,
264
344
  * priority: 1,
265
345
  * },
266
346
  * {
@@ -279,7 +359,7 @@ interface OutputOptions {
279
359
  * - Type: `number`
280
360
  * - Default: `0`
281
361
  *
282
- * Minimum size of the desired chunk. If the accumulated size of the captured modules by this group is smaller than this value, it will be ignored. Modules in this group will fall back to the `automatic chunking` if they are not captured by any other group.
362
+ * Minimum size in bytes of the desired chunk. If the accumulated size of the captured modules by this group is smaller than this value, it will be ignored. Modules in this group will fall back to the `automatic chunking` if they are not captured by any other group.
283
363
  */
284
364
  minSize?: number;
285
365
  /**
@@ -293,21 +373,21 @@ interface OutputOptions {
293
373
  * - Type: `number`
294
374
  * - Default: `Infinity`
295
375
  *
296
- * If the accumulated size of the captured modules by this group is larger than this value, this group will be split into multiple groups that each has size close to this value.
376
+ * If the accumulated size in bytes of the captured modules by this group is larger than this value, this group will be split into multiple groups that each has size close to this value.
297
377
  */
298
378
  maxSize?: number;
299
379
  /**
300
380
  * - Type: `number`
301
381
  * - Default: `Infinity`
302
382
  *
303
- * Controls a module could only be captured if its size is smaller or equal than this value.
383
+ * Controls a module could only be captured if its size in bytes is smaller or equal than this value.
304
384
  */
305
385
  maxModuleSize?: number;
306
386
  /**
307
387
  * - Type: `number`
308
388
  * - Default: `0`
309
389
  *
310
- * Controls a module could only be captured if its size is larger or equal than this value.
390
+ * Controls a module could only be captured if its size in bytes is larger or equal than this value.
311
391
  */
312
392
  minModuleSize?: number;
313
393
  }[];
@@ -980,6 +1060,19 @@ interface InputOptions {
980
1060
  viteMode?: boolean;
981
1061
  resolveNewUrlToAsset?: boolean;
982
1062
  hmr?: HmrOptions;
1063
+ /**
1064
+ * Attach debug information to the output bundle.
1065
+ *
1066
+ * - Type: `'none' | 'simple' | 'full'`
1067
+ * - Default: `'simple'`
1068
+ *
1069
+ * - `none`: No debug information is attached.
1070
+ * - `simple`: Attach comments indicating which files the bundled code comes from. These comments could be removed by the minifier.
1071
+ * - `full`: Attach detailed debug information to the output bundle. These comments are using legal comment syntax, so they won't be removed by the minifier.
1072
+ *
1073
+ * > [!WARNING]
1074
+ * > You shouldn't use `full` in the production build.
1075
+ */
983
1076
  attachDebugInfo?: AttachDebugOptions;
984
1077
  };
985
1078
  /**
@@ -1,4 +1,4 @@
1
- import { rolldown } from "./src-D1ozKBtx.mjs";
1
+ import { rolldown } from "./src-C55LDCFJ.mjs";
2
2
  import path from "node:path";
3
3
  import { pathToFileURL } from "node:url";
4
4
  import { cwd } from "node:process";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_src = require('./src-BP3CtG4Q.cjs');
2
+ const require_src = require('./src-DamX4spE.cjs');
3
3
  const node_path = require_chunk.__toESM(require("node:path"));
4
4
  const node_url = require_chunk.__toESM(require("node:url"));
5
5
  const node_process = require_chunk.__toESM(require("node:process"));
@@ -15,7 +15,7 @@ const ELLIPSIS = "...";
15
15
  function getCodeFrame(source, line, column) {
16
16
  let lines = source.split("\n");
17
17
  if (line > lines.length) return "";
18
- const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + ELLIPSIS.length, LINE_TRUNCATE_LENGTH);
18
+ const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + 3, LINE_TRUNCATE_LENGTH);
19
19
  const frameStart = Math.max(0, line - 3);
20
20
  let frameEnd = Math.min(line + 2, lines.length);
21
21
  lines = lines.slice(frameStart, frameEnd);
@@ -29,7 +29,7 @@ function getCodeFrame(source, line, column) {
29
29
  let lineNumber = String(index + frameStart + 1);
30
30
  while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
31
31
  let displayedLine = tabsToSpaces(sourceLine);
32
- if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - ELLIPSIS.length)}${ELLIPSIS}`;
32
+ if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - 3)}${ELLIPSIS}`;
33
33
  if (isErrorLine) {
34
34
  const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
35
35
  return `${lineNumber}: ${displayedLine}\n${indicator}`;
@@ -180,7 +180,7 @@ function augmentCodeLocation(properties, pos, source, id) {
180
180
  }
181
181
 
182
182
  //#endregion
183
- //#region ../../node_modules/.pnpm/oxc-parser@0.73.2/node_modules/oxc-parser/wrap.mjs
183
+ //#region ../../node_modules/.pnpm/oxc-parser@0.75.0/node_modules/oxc-parser/wrap.mjs
184
184
  function wrap$1(result) {
185
185
  let program, module, comments, errors;
186
186
  return {
@@ -16,7 +16,7 @@ const ELLIPSIS = "...";
16
16
  function getCodeFrame(source, line, column) {
17
17
  let lines = source.split("\n");
18
18
  if (line > lines.length) return "";
19
- const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + ELLIPSIS.length, LINE_TRUNCATE_LENGTH);
19
+ const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + 3, LINE_TRUNCATE_LENGTH);
20
20
  const frameStart = Math.max(0, line - 3);
21
21
  let frameEnd = Math.min(line + 2, lines.length);
22
22
  lines = lines.slice(frameStart, frameEnd);
@@ -30,7 +30,7 @@ function getCodeFrame(source, line, column) {
30
30
  let lineNumber = String(index + frameStart + 1);
31
31
  while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
32
32
  let displayedLine = tabsToSpaces(sourceLine);
33
- if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - ELLIPSIS.length)}${ELLIPSIS}`;
33
+ if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - 3)}${ELLIPSIS}`;
34
34
  if (isErrorLine) {
35
35
  const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
36
36
  return `${lineNumber}: ${displayedLine}\n${indicator}`;
@@ -181,7 +181,7 @@ function augmentCodeLocation(properties, pos, source, id) {
181
181
  }
182
182
 
183
183
  //#endregion
184
- //#region ../../node_modules/.pnpm/oxc-parser@0.73.2/node_modules/oxc-parser/wrap.mjs
184
+ //#region ../../node_modules/.pnpm/oxc-parser@0.75.0/node_modules/oxc-parser/wrap.mjs
185
185
  function wrap$1(result) {
186
186
  let program, module$1, comments, errors;
187
187
  return {
@@ -1,5 +1,5 @@
1
1
  import { and, arraify, code, exclude, id, include, isNullish, moduleType, noop, or, unimplemented, unreachable, unsupported } from "./dist-BoWaIc-K.mjs";
2
- import { augmentCodeLocation, error, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-BHw-MFh6.mjs";
2
+ import { augmentCodeLocation, error, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-BzdtcWzA.mjs";
3
3
  import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
4
4
  import path from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -33,7 +33,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
 
34
34
  //#endregion
35
35
  //#region package.json
36
- var version = "1.0.0-beta.18";
36
+ var version = "1.0.0-beta.20";
37
37
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
38
38
 
39
39
  //#endregion
@@ -2238,7 +2238,7 @@ const AdvancedChunksSchema = strictObject({
2238
2238
  maxModuleSize: optional(number()),
2239
2239
  minShareCount: optional(number()),
2240
2240
  groups: optional(array(strictObject({
2241
- name: string(),
2241
+ name: union([string(), pipe(function_(), args(tuple([string()])), returns(nullish(string())))]),
2242
2242
  test: optional(union([
2243
2243
  string(),
2244
2244
  instance(RegExp),
@@ -2296,7 +2296,7 @@ const OutputOptionsSchema = strictObject({
2296
2296
  globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
2297
2297
  externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
2298
2298
  inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
2299
- manualChunks: optional(never("manualChunks is not supported. Please use advancedChunks instead")),
2299
+ manualChunks: optional(pipe(function_(), args(tuple([string(), object({})])), returns(union([string(), nullish(string())])))),
2300
2300
  advancedChunks: optional(AdvancedChunksSchema),
2301
2301
  legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
2302
2302
  plugins: optional(custom(() => true)),
@@ -3095,7 +3095,12 @@ function transformChunkModules(modules) {
3095
3095
  //#endregion
3096
3096
  //#region src/utils/bindingify-output-options.ts
3097
3097
  function bindingifyOutputOptions(outputOptions) {
3098
- const { dir, format, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot } = outputOptions;
3098
+ const { dir, format, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks } = outputOptions;
3099
+ let { advancedChunks } = outputOptions;
3100
+ if (manualChunks != null && advancedChunks != null) console.warn("`manualChunks` option is ignored due to `advancedChunks` option is specified.");
3101
+ else if (manualChunks != null) advancedChunks = { groups: [{ name(id$1) {
3102
+ return manualChunks(id$1, {});
3103
+ } }] };
3099
3104
  return {
3100
3105
  dir,
3101
3106
  file: file == null ? void 0 : file,
@@ -3123,7 +3128,7 @@ function bindingifyOutputOptions(outputOptions) {
3123
3128
  minify: outputOptions.minify,
3124
3129
  externalLiveBindings: outputOptions.externalLiveBindings,
3125
3130
  inlineDynamicImports: outputOptions.inlineDynamicImports,
3126
- advancedChunks: outputOptions.advancedChunks,
3131
+ advancedChunks,
3127
3132
  polyfillRequire: outputOptions.polyfillRequire,
3128
3133
  sanitizeFileName,
3129
3134
  preserveModules,
@@ -4397,10 +4402,10 @@ function isComposablePlugin(plugin) {
4397
4402
  const hasNotComposablePattern = t(plugin).some((hookName) => {
4398
4403
  if (!isPluginHookName(hookName)) return false;
4399
4404
  const OK_TO_COMPOSE = false;
4400
- if (isUnsupportedHooks(hookName)) return !OK_TO_COMPOSE;
4405
+ if (isUnsupportedHooks(hookName)) return true;
4401
4406
  if (plugin[hookName]) {
4402
4407
  const { meta } = normalizeHook(plugin[hookName]);
4403
- if (meta.order === "pre" || meta.order === "post") return !OK_TO_COMPOSE;
4408
+ if (meta.order === "pre" || meta.order === "post") return true;
4404
4409
  }
4405
4410
  return OK_TO_COMPOSE;
4406
4411
  });
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
2
  const require_dist = require('./dist-BMVjvV-v.cjs');
3
- const require_parse_ast_index = require('./parse-ast-index-DQhRVBEm.cjs');
3
+ const require_parse_ast_index = require('./parse-ast-index-CGTVCgvx.cjs');
4
4
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("../rolldown-binding.wasi.cjs"));
5
5
  const node_path = require_chunk.__toESM(require("node:path"));
6
6
  const node_url = require_chunk.__toESM(require("node:url"));
@@ -8,7 +8,7 @@ const node_os = require_chunk.__toESM(require("node:os"));
8
8
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
9
9
 
10
10
  //#region package.json
11
- var version = "1.0.0-beta.18";
11
+ var version = "1.0.0-beta.20";
12
12
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
13
13
 
14
14
  //#endregion
@@ -2213,7 +2213,7 @@ const AdvancedChunksSchema = strictObject({
2213
2213
  maxModuleSize: optional(number()),
2214
2214
  minShareCount: optional(number()),
2215
2215
  groups: optional(array(strictObject({
2216
- name: string(),
2216
+ name: union([string(), pipe(function_(), args(tuple([string()])), returns(nullish(string())))]),
2217
2217
  test: optional(union([
2218
2218
  string(),
2219
2219
  instance(RegExp),
@@ -2271,7 +2271,7 @@ const OutputOptionsSchema = strictObject({
2271
2271
  globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
2272
2272
  externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
2273
2273
  inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
2274
- manualChunks: optional(never("manualChunks is not supported. Please use advancedChunks instead")),
2274
+ manualChunks: optional(pipe(function_(), args(tuple([string(), object({})])), returns(union([string(), nullish(string())])))),
2275
2275
  advancedChunks: optional(AdvancedChunksSchema),
2276
2276
  legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
2277
2277
  plugins: optional(custom(() => true)),
@@ -3070,7 +3070,12 @@ function transformChunkModules(modules) {
3070
3070
  //#endregion
3071
3071
  //#region src/utils/bindingify-output-options.ts
3072
3072
  function bindingifyOutputOptions(outputOptions) {
3073
- const { dir, format, exports: exports$1, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot } = outputOptions;
3073
+ const { dir, format, exports: exports$1, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks } = outputOptions;
3074
+ let { advancedChunks } = outputOptions;
3075
+ if (manualChunks != null && advancedChunks != null) console.warn("`manualChunks` option is ignored due to `advancedChunks` option is specified.");
3076
+ else if (manualChunks != null) advancedChunks = { groups: [{ name(id$1) {
3077
+ return manualChunks(id$1, {});
3078
+ } }] };
3074
3079
  return {
3075
3080
  dir,
3076
3081
  file: file == null ? void 0 : file,
@@ -3098,7 +3103,7 @@ function bindingifyOutputOptions(outputOptions) {
3098
3103
  minify: outputOptions.minify,
3099
3104
  externalLiveBindings: outputOptions.externalLiveBindings,
3100
3105
  inlineDynamicImports: outputOptions.inlineDynamicImports,
3101
- advancedChunks: outputOptions.advancedChunks,
3106
+ advancedChunks,
3102
3107
  polyfillRequire: outputOptions.polyfillRequire,
3103
3108
  sanitizeFileName,
3104
3109
  preserveModules,
@@ -4372,10 +4377,10 @@ function isComposablePlugin(plugin) {
4372
4377
  const hasNotComposablePattern = t(plugin).some((hookName) => {
4373
4378
  if (!isPluginHookName(hookName)) return false;
4374
4379
  const OK_TO_COMPOSE = false;
4375
- if (isUnsupportedHooks(hookName)) return !OK_TO_COMPOSE;
4380
+ if (isUnsupportedHooks(hookName)) return true;
4376
4381
  if (plugin[hookName]) {
4377
4382
  const { meta } = normalizeHook(plugin[hookName]);
4378
- if (meta.order === "pre" || meta.order === "post") return !OK_TO_COMPOSE;
4383
+ if (meta.order === "pre" || meta.order === "post") return true;
4379
4384
  }
4380
4385
  return OK_TO_COMPOSE;
4381
4386
  });
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
 
28
28
  //#endregion
29
29
  //#region package.json
30
- var version = "1.0.0-beta.18";
30
+ var version = "1.0.0-beta.20";
31
31
 
32
32
  //#endregion
33
33
  //#region src/builtin-plugin/utils.ts
@@ -626,7 +626,7 @@ const ELLIPSIS = "...";
626
626
  function getCodeFrame(source, line, column) {
627
627
  let lines = source.split("\n");
628
628
  if (line > lines.length) return "";
629
- const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + ELLIPSIS.length, LINE_TRUNCATE_LENGTH);
629
+ const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + 3, LINE_TRUNCATE_LENGTH);
630
630
  const frameStart = Math.max(0, line - 3);
631
631
  let frameEnd = Math.min(line + 2, lines.length);
632
632
  lines = lines.slice(frameStart, frameEnd);
@@ -640,7 +640,7 @@ function getCodeFrame(source, line, column) {
640
640
  let lineNumber = String(index + frameStart + 1);
641
641
  while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
642
642
  let displayedLine = tabsToSpaces(sourceLine);
643
- if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - ELLIPSIS.length)}${ELLIPSIS}`;
643
+ if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - 3)}${ELLIPSIS}`;
644
644
  if (isErrorLine) {
645
645
  const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
646
646
  return `${lineNumber}: ${displayedLine}\n${indicator}`;
@@ -2424,7 +2424,7 @@ const AdvancedChunksSchema = strictObject({
2424
2424
  maxModuleSize: optional(number()),
2425
2425
  minShareCount: optional(number()),
2426
2426
  groups: optional(array(strictObject({
2427
- name: string(),
2427
+ name: union([string(), pipe(function_(), args(tuple([string()])), returns(nullish(string())))]),
2428
2428
  test: optional(union([
2429
2429
  string(),
2430
2430
  instance(RegExp),
@@ -2482,7 +2482,7 @@ const OutputOptionsSchema = strictObject({
2482
2482
  globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
2483
2483
  externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
2484
2484
  inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
2485
- manualChunks: optional(never("manualChunks is not supported. Please use advancedChunks instead")),
2485
+ manualChunks: optional(pipe(function_(), args(tuple([string(), object({})])), returns(union([string(), nullish(string())])))),
2486
2486
  advancedChunks: optional(AdvancedChunksSchema),
2487
2487
  legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
2488
2488
  plugins: optional(custom(() => true)),
@@ -2983,7 +2983,7 @@ function bindingPluginOrder(order) {
2983
2983
  }
2984
2984
 
2985
2985
  //#endregion
2986
- //#region ../../node_modules/.pnpm/oxc-parser@0.73.2/node_modules/oxc-parser/wrap.mjs
2986
+ //#region ../../node_modules/.pnpm/oxc-parser@0.75.0/node_modules/oxc-parser/wrap.mjs
2987
2987
  function wrap$1(result) {
2988
2988
  let program, module$1, comments, errors;
2989
2989
  return {
@@ -3420,7 +3420,12 @@ function transformChunkModules(modules) {
3420
3420
  //#endregion
3421
3421
  //#region src/utils/bindingify-output-options.ts
3422
3422
  function bindingifyOutputOptions(outputOptions) {
3423
- const { dir, format: format$1, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot } = outputOptions;
3423
+ const { dir, format: format$1, exports, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks } = outputOptions;
3424
+ let { advancedChunks } = outputOptions;
3425
+ if (manualChunks != null && advancedChunks != null) console.warn("`manualChunks` option is ignored due to `advancedChunks` option is specified.");
3426
+ else if (manualChunks != null) advancedChunks = { groups: [{ name(id$1) {
3427
+ return manualChunks(id$1, {});
3428
+ } }] };
3424
3429
  return {
3425
3430
  dir,
3426
3431
  file: file == null ? void 0 : file,
@@ -3448,7 +3453,7 @@ function bindingifyOutputOptions(outputOptions) {
3448
3453
  minify: outputOptions.minify,
3449
3454
  externalLiveBindings: outputOptions.externalLiveBindings,
3450
3455
  inlineDynamicImports: outputOptions.inlineDynamicImports,
3451
- advancedChunks: outputOptions.advancedChunks,
3456
+ advancedChunks,
3452
3457
  polyfillRequire: outputOptions.polyfillRequire,
3453
3458
  sanitizeFileName,
3454
3459
  preserveModules,
@@ -4722,10 +4727,10 @@ function isComposablePlugin(plugin) {
4722
4727
  const hasNotComposablePattern = t(plugin).some((hookName) => {
4723
4728
  if (!isPluginHookName(hookName)) return false;
4724
4729
  const OK_TO_COMPOSE = false;
4725
- if (isUnsupportedHooks(hookName)) return !OK_TO_COMPOSE;
4730
+ if (isUnsupportedHooks(hookName)) return true;
4726
4731
  if (plugin[hookName]) {
4727
4732
  const { meta } = normalizeHook(plugin[hookName]);
4728
- if (meta.order === "pre" || meta.order === "post") return !OK_TO_COMPOSE;
4733
+ if (meta.order === "pre" || meta.order === "post") return true;
4729
4734
  }
4730
4735
  return OK_TO_COMPOSE;
4731
4736
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolldown/browser",
3
- "version": "1.0.0-beta.18",
3
+ "version": "1.0.0-beta.20",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "type": "module",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@napi-rs/wasm-runtime": "^0.2.10",
59
- "@oxc-project/runtime": "=0.73.2"
59
+ "@oxc-project/runtime": "=0.75.0"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "pnpm run build:debug",