rolldown 1.0.0-beta.17 → 1.0.0-beta.19

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 (35) 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.cjs +2 -2
  8. package/dist/experimental-index.d.cts +2 -2
  9. package/dist/experimental-index.d.mts +2 -2
  10. package/dist/experimental-index.mjs +2 -2
  11. package/dist/filter-index.d.cts +2 -2
  12. package/dist/filter-index.d.mts +2 -2
  13. package/dist/index.cjs +2 -2
  14. package/dist/index.d.cts +2 -2
  15. package/dist/index.d.mts +2 -2
  16. package/dist/index.mjs +2 -2
  17. package/dist/parallel-plugin-worker.cjs +2 -2
  18. package/dist/parallel-plugin-worker.mjs +2 -2
  19. package/dist/parallel-plugin.d.cts +2 -2
  20. package/dist/parallel-plugin.d.mts +2 -2
  21. package/dist/parse-ast-index.cjs +1 -1
  22. package/dist/parse-ast-index.d.cts +1 -1
  23. package/dist/parse-ast-index.d.mts +1 -1
  24. package/dist/parse-ast-index.mjs +1 -1
  25. package/dist/shared/{binding-CWvDTpOw.d.mts → binding-D__94uwg.d.cts} +0 -449
  26. package/dist/shared/{binding-um3VI33z.d.cts → binding-DwMf_OTa.d.mts} +0 -449
  27. package/dist/shared/{define-config-Cm86JHb7.d.mts → define-config-DbVCmJuw.d.mts} +101 -8
  28. package/dist/shared/{define-config-POPyhxOq.d.cts → define-config-STK7IJOm.d.cts} +101 -8
  29. package/dist/shared/{load-config-BlOqMlge.mjs → load-config-1njcvXB4.mjs} +1 -1
  30. package/dist/shared/{load-config-B4zzmrcW.cjs → load-config-eihhr0rx.cjs} +1 -1
  31. package/dist/shared/{parse-ast-index-XFcW-g8N.cjs → parse-ast-index-BbUPYP6B.cjs} +1 -1
  32. package/dist/shared/{parse-ast-index-BpqxVgDm.mjs → parse-ast-index-QIuIuIzO.mjs} +1 -1
  33. package/dist/shared/{src-CuIbdNSi.mjs → src-BfENRohl.mjs} +12 -6
  34. package/dist/shared/{src-C98Q0NLX.cjs → src-DKoBj13M.cjs} +12 -6
  35. package/package.json +18 -18
@@ -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-CWvDTpOw.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-DwMf_OTa.mjs";
2
2
  import { TopLevelFilterExpression } from "@rolldown/pluginutils";
3
3
  import { Program } from "@oxc-project/types";
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-um3VI33z.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-D__94uwg.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 { rolldown } from "./src-CuIbdNSi.mjs";
1
+ import { rolldown } from "./src-BfENRohl.mjs";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import { pathToFileURL } from "node:url";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_src = require('./src-C98Q0NLX.cjs');
2
+ const require_src = require('./src-DKoBj13M.cjs');
3
3
  const node_fs = require_chunk.__toESM(require("node:fs"));
4
4
  const node_path = require_chunk.__toESM(require("node:path"));
5
5
  const node_url = require_chunk.__toESM(require("node:url"));
@@ -509,7 +509,7 @@ function augmentCodeLocation(properties, pos, source, id) {
509
509
  }
510
510
 
511
511
  //#endregion
512
- //#region ../../node_modules/.pnpm/oxc-parser@0.73.0/node_modules/oxc-parser/wrap.mjs
512
+ //#region ../../node_modules/.pnpm/oxc-parser@0.73.2/node_modules/oxc-parser/wrap.mjs
513
513
  function wrap$1(result) {
514
514
  let program, module$1, comments, errors;
515
515
  return {
@@ -536,7 +536,7 @@ function augmentCodeLocation(properties, pos, source, id) {
536
536
  }
537
537
 
538
538
  //#endregion
539
- //#region ../../node_modules/.pnpm/oxc-parser@0.73.0/node_modules/oxc-parser/wrap.mjs
539
+ //#region ../../node_modules/.pnpm/oxc-parser@0.73.2/node_modules/oxc-parser/wrap.mjs
540
540
  function wrap$1(result) {
541
541
  let program, module$1, comments, errors;
542
542
  return {
@@ -1,4 +1,4 @@
1
- import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-BpqxVgDm.mjs";
1
+ import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-QIuIuIzO.mjs";
2
2
  import { arraify, isNullish, noop, unimplemented, unreachable, unsupported } from "./misc-BN0nse6C.mjs";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
@@ -8,7 +8,7 @@ import os from "node:os";
8
8
  import { Worker } from "node:worker_threads";
9
9
 
10
10
  //#region package.json
11
- var version = "1.0.0-beta.17";
11
+ var version = "1.0.0-beta.19";
12
12
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
13
13
 
14
14
  //#endregion
@@ -2022,6 +2022,7 @@ const InputOptionsSchema = strictObject({
2022
2022
  experimental: optional(strictObject({
2023
2023
  disableLiveBindings: optional(boolean()),
2024
2024
  enableComposingJsPlugins: optional(boolean()),
2025
+ viteMode: optional(boolean()),
2025
2026
  resolveNewUrlToAsset: optional(boolean()),
2026
2027
  strictExecutionOrder: optional(boolean()),
2027
2028
  hmr: optional(HmrSchema),
@@ -2101,7 +2102,7 @@ const AdvancedChunksSchema = strictObject({
2101
2102
  maxModuleSize: optional(number()),
2102
2103
  minShareCount: optional(number()),
2103
2104
  groups: optional(array(strictObject({
2104
- name: string(),
2105
+ name: union([string(), pipe(function_(), args(tuple([string()])), returns(nullish(string())))]),
2105
2106
  test: optional(union([
2106
2107
  string(),
2107
2108
  instance(RegExp),
@@ -2159,7 +2160,7 @@ const OutputOptionsSchema = strictObject({
2159
2160
  globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
2160
2161
  externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
2161
2162
  inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
2162
- manualChunks: optional(never("manualChunks is not supported. Please use advancedChunks instead")),
2163
+ manualChunks: optional(pipe(function_(), args(tuple([string(), object({})])), returns(union([string(), nullish(string())])))),
2163
2164
  advancedChunks: optional(AdvancedChunksSchema),
2164
2165
  legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
2165
2166
  plugins: optional(custom(() => true)),
@@ -2958,7 +2959,12 @@ function transformChunkModules(modules) {
2958
2959
  //#endregion
2959
2960
  //#region src/utils/bindingify-output-options.ts
2960
2961
  function bindingifyOutputOptions(outputOptions) {
2961
- 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;
2962
+ 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;
2963
+ let { advancedChunks } = outputOptions;
2964
+ if (manualChunks != null && advancedChunks != null) console.warn("`manualChunks` option is ignored due to `advancedChunks` option is specified.");
2965
+ else if (manualChunks != null) advancedChunks = { groups: [{ name(id) {
2966
+ return manualChunks(id, {});
2967
+ } }] };
2962
2968
  return {
2963
2969
  dir,
2964
2970
  file: file == null ? void 0 : file,
@@ -2986,7 +2992,7 @@ function bindingifyOutputOptions(outputOptions) {
2986
2992
  minify: outputOptions.minify,
2987
2993
  externalLiveBindings: outputOptions.externalLiveBindings,
2988
2994
  inlineDynamicImports: outputOptions.inlineDynamicImports,
2989
- advancedChunks: outputOptions.advancedChunks,
2995
+ advancedChunks,
2990
2996
  polyfillRequire: outputOptions.polyfillRequire,
2991
2997
  sanitizeFileName,
2992
2998
  preserveModules,
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_parse_ast_index = require('./parse-ast-index-XFcW-g8N.cjs');
2
+ const require_parse_ast_index = require('./parse-ast-index-BbUPYP6B.cjs');
3
3
  const require_misc = require('./misc-BKp5iIef.cjs');
4
4
  const node_path = require_chunk.__toESM(require("node:path"));
5
5
  const node_url = require_chunk.__toESM(require("node:url"));
@@ -9,7 +9,7 @@ const node_os = require_chunk.__toESM(require("node:os"));
9
9
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
10
10
 
11
11
  //#region package.json
12
- var version = "1.0.0-beta.17";
12
+ var version = "1.0.0-beta.19";
13
13
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
14
14
 
15
15
  //#endregion
@@ -2023,6 +2023,7 @@ const InputOptionsSchema = strictObject({
2023
2023
  experimental: optional(strictObject({
2024
2024
  disableLiveBindings: optional(boolean()),
2025
2025
  enableComposingJsPlugins: optional(boolean()),
2026
+ viteMode: optional(boolean()),
2026
2027
  resolveNewUrlToAsset: optional(boolean()),
2027
2028
  strictExecutionOrder: optional(boolean()),
2028
2029
  hmr: optional(HmrSchema),
@@ -2102,7 +2103,7 @@ const AdvancedChunksSchema = strictObject({
2102
2103
  maxModuleSize: optional(number()),
2103
2104
  minShareCount: optional(number()),
2104
2105
  groups: optional(array(strictObject({
2105
- name: string(),
2106
+ name: union([string(), pipe(function_(), args(tuple([string()])), returns(nullish(string())))]),
2106
2107
  test: optional(union([
2107
2108
  string(),
2108
2109
  instance(RegExp),
@@ -2160,7 +2161,7 @@ const OutputOptionsSchema = strictObject({
2160
2161
  globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
2161
2162
  externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
2162
2163
  inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
2163
- manualChunks: optional(never("manualChunks is not supported. Please use advancedChunks instead")),
2164
+ manualChunks: optional(pipe(function_(), args(tuple([string(), object({})])), returns(union([string(), nullish(string())])))),
2164
2165
  advancedChunks: optional(AdvancedChunksSchema),
2165
2166
  legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
2166
2167
  plugins: optional(custom(() => true)),
@@ -2959,7 +2960,12 @@ function transformChunkModules(modules) {
2959
2960
  //#endregion
2960
2961
  //#region src/utils/bindingify-output-options.ts
2961
2962
  function bindingifyOutputOptions(outputOptions) {
2962
- 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;
2963
+ 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;
2964
+ let { advancedChunks } = outputOptions;
2965
+ if (manualChunks != null && advancedChunks != null) console.warn("`manualChunks` option is ignored due to `advancedChunks` option is specified.");
2966
+ else if (manualChunks != null) advancedChunks = { groups: [{ name(id) {
2967
+ return manualChunks(id, {});
2968
+ } }] };
2963
2969
  return {
2964
2970
  dir,
2965
2971
  file: file == null ? void 0 : file,
@@ -2987,7 +2993,7 @@ function bindingifyOutputOptions(outputOptions) {
2987
2993
  minify: outputOptions.minify,
2988
2994
  externalLiveBindings: outputOptions.externalLiveBindings,
2989
2995
  inlineDynamicImports: outputOptions.inlineDynamicImports,
2990
- advancedChunks: outputOptions.advancedChunks,
2996
+ advancedChunks,
2991
2997
  polyfillRequire: outputOptions.polyfillRequire,
2992
2998
  sanitizeFileName,
2993
2999
  preserveModules,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.17",
3
+ "version": "1.0.0-beta.19",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "type": "module",
6
6
  "homepage": "https://rolldown.rs/",
@@ -90,10 +90,10 @@
90
90
  "dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\n\n"
91
91
  },
92
92
  "dependencies": {
93
- "@oxc-project/runtime": "=0.73.0",
94
- "@oxc-project/types": "=0.73.0",
93
+ "@oxc-project/runtime": "=0.73.2",
94
+ "@oxc-project/types": "=0.73.2",
95
95
  "ansis": "^4.0.0",
96
- "@rolldown/pluginutils": "1.0.0-beta.17"
96
+ "@rolldown/pluginutils": "1.0.0-beta.19"
97
97
  },
98
98
  "devDependencies": {
99
99
  "@napi-rs/cli": "3.0.0-alpha.89",
@@ -106,7 +106,7 @@
106
106
  "emnapi": "^1.2.0",
107
107
  "execa": "^9.2.0",
108
108
  "glob": "^11.0.0",
109
- "oxc-parser": "=0.73.0",
109
+ "oxc-parser": "=0.73.2",
110
110
  "pathe": "^2.0.3",
111
111
  "remeda": "^2.10.0",
112
112
  "rolldown-plugin-dts": "^0.13.6",
@@ -119,21 +119,21 @@
119
119
  "typescript": "^5.7.3",
120
120
  "valibot": "1.1.0",
121
121
  "@rolldown/testing": "0.0.1",
122
- "rolldown": "1.0.0-beta.17"
122
+ "rolldown": "1.0.0-beta.19"
123
123
  },
124
124
  "optionalDependencies": {
125
- "@rolldown/binding-darwin-x64": "1.0.0-beta.17",
126
- "@rolldown/binding-darwin-arm64": "1.0.0-beta.17",
127
- "@rolldown/binding-freebsd-x64": "1.0.0-beta.17",
128
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.17",
129
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.17",
130
- "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.17",
131
- "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.17",
132
- "@rolldown/binding-linux-x64-musl": "1.0.0-beta.17",
133
- "@rolldown/binding-wasm32-wasi": "1.0.0-beta.17",
134
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.17",
135
- "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.17",
136
- "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.17"
125
+ "@rolldown/binding-darwin-arm64": "1.0.0-beta.19",
126
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.19",
127
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.19",
128
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.19",
129
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.19",
130
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.19",
131
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.19",
132
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.19",
133
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.19",
134
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.19",
135
+ "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.19",
136
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.19"
137
137
  },
138
138
  "scripts": {
139
139
  "# Scrips for binding #": "_",