@rolldown/browser 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 (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 -1
  8. package/dist/experimental-index.cjs +2 -2
  9. package/dist/experimental-index.d.cts +2 -2
  10. package/dist/experimental-index.d.mts +2 -2
  11. package/dist/experimental-index.mjs +2 -2
  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-CWvDTpOw.d.mts → binding-D__94uwg.d.cts} +0 -449
  29. package/dist/shared/{binding-um3VI33z.d.cts → binding-DwMf_OTa.d.mts} +0 -449
  30. package/dist/shared/{define-config-DETTMcOl.d.mts → define-config-DinD1Bta.d.mts} +101 -8
  31. package/dist/shared/{define-config-POPyhxOq.d.cts → define-config-STK7IJOm.d.cts} +101 -8
  32. package/dist/shared/{load-config-Cp5Lu-qW.cjs → load-config-CC2eQgDy.cjs} +1 -1
  33. package/dist/shared/{load-config-C0FU-xTD.mjs → load-config-Cb7g06QH.mjs} +1 -1
  34. package/dist/shared/{parse-ast-index-B5AmHtd5.mjs → parse-ast-index-BHw-MFh6.mjs} +1 -1
  35. package/dist/shared/{parse-ast-index-X4pECV1E.cjs → parse-ast-index-DQhRVBEm.cjs} +1 -1
  36. package/dist/shared/{src-D8KQ1KMN.cjs → src-B0_Q9W-Q.cjs} +12 -6
  37. package/dist/shared/{src-CsIMaM6C.mjs → src-jYrhBNtz.mjs} +12 -6
  38. package/dist/{src-Bv_xHi2_.js → src-CLm8PUu7.js} +12 -6
  39. package/package.json +2 -2
@@ -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 { 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-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,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_src = require('./src-D8KQ1KMN.cjs');
2
+ const require_src = require('./src-B0_Q9W-Q.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"));
@@ -1,4 +1,4 @@
1
- import { rolldown } from "./src-CsIMaM6C.mjs";
1
+ import { rolldown } from "./src-jYrhBNtz.mjs";
2
2
  import path from "node:path";
3
3
  import { pathToFileURL } from "node:url";
4
4
  import { cwd } from "node:process";
@@ -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.0/node_modules/oxc-parser/wrap.mjs
183
+ //#region ../../node_modules/.pnpm/oxc-parser@0.73.2/node_modules/oxc-parser/wrap.mjs
184
184
  function wrap$1(result) {
185
185
  let program, module, comments, errors;
186
186
  return {
@@ -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.0/node_modules/oxc-parser/wrap.mjs
184
+ //#region ../../node_modules/.pnpm/oxc-parser@0.73.2/node_modules/oxc-parser/wrap.mjs
185
185
  function wrap$1(result) {
186
186
  let program, module$1, comments, errors;
187
187
  return {
@@ -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-X4pECV1E.cjs');
3
+ const require_parse_ast_index = require('./parse-ast-index-DQhRVBEm.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.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
@@ -2133,6 +2133,7 @@ const InputOptionsSchema = strictObject({
2133
2133
  experimental: optional(strictObject({
2134
2134
  disableLiveBindings: optional(boolean()),
2135
2135
  enableComposingJsPlugins: optional(boolean()),
2136
+ viteMode: optional(boolean()),
2136
2137
  resolveNewUrlToAsset: optional(boolean()),
2137
2138
  strictExecutionOrder: optional(boolean()),
2138
2139
  hmr: optional(HmrSchema),
@@ -2212,7 +2213,7 @@ const AdvancedChunksSchema = strictObject({
2212
2213
  maxModuleSize: optional(number()),
2213
2214
  minShareCount: optional(number()),
2214
2215
  groups: optional(array(strictObject({
2215
- name: string(),
2216
+ name: union([string(), pipe(function_(), args(tuple([string()])), returns(nullish(string())))]),
2216
2217
  test: optional(union([
2217
2218
  string(),
2218
2219
  instance(RegExp),
@@ -2270,7 +2271,7 @@ const OutputOptionsSchema = strictObject({
2270
2271
  globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
2271
2272
  externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
2272
2273
  inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
2273
- 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())])))),
2274
2275
  advancedChunks: optional(AdvancedChunksSchema),
2275
2276
  legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
2276
2277
  plugins: optional(custom(() => true)),
@@ -3069,7 +3070,12 @@ function transformChunkModules(modules) {
3069
3070
  //#endregion
3070
3071
  //#region src/utils/bindingify-output-options.ts
3071
3072
  function bindingifyOutputOptions(outputOptions) {
3072
- 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
+ } }] };
3073
3079
  return {
3074
3080
  dir,
3075
3081
  file: file == null ? void 0 : file,
@@ -3097,7 +3103,7 @@ function bindingifyOutputOptions(outputOptions) {
3097
3103
  minify: outputOptions.minify,
3098
3104
  externalLiveBindings: outputOptions.externalLiveBindings,
3099
3105
  inlineDynamicImports: outputOptions.inlineDynamicImports,
3100
- advancedChunks: outputOptions.advancedChunks,
3106
+ advancedChunks,
3101
3107
  polyfillRequire: outputOptions.polyfillRequire,
3102
3108
  sanitizeFileName,
3103
3109
  preserveModules,
@@ -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-B5AmHtd5.mjs";
2
+ import { augmentCodeLocation, error, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-BHw-MFh6.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.17";
36
+ var version = "1.0.0-beta.19";
37
37
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
38
38
 
39
39
  //#endregion
@@ -2158,6 +2158,7 @@ const InputOptionsSchema = strictObject({
2158
2158
  experimental: optional(strictObject({
2159
2159
  disableLiveBindings: optional(boolean()),
2160
2160
  enableComposingJsPlugins: optional(boolean()),
2161
+ viteMode: optional(boolean()),
2161
2162
  resolveNewUrlToAsset: optional(boolean()),
2162
2163
  strictExecutionOrder: optional(boolean()),
2163
2164
  hmr: optional(HmrSchema),
@@ -2237,7 +2238,7 @@ const AdvancedChunksSchema = strictObject({
2237
2238
  maxModuleSize: optional(number()),
2238
2239
  minShareCount: optional(number()),
2239
2240
  groups: optional(array(strictObject({
2240
- name: string(),
2241
+ name: union([string(), pipe(function_(), args(tuple([string()])), returns(nullish(string())))]),
2241
2242
  test: optional(union([
2242
2243
  string(),
2243
2244
  instance(RegExp),
@@ -2295,7 +2296,7 @@ const OutputOptionsSchema = strictObject({
2295
2296
  globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
2296
2297
  externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
2297
2298
  inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
2298
- 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())])))),
2299
2300
  advancedChunks: optional(AdvancedChunksSchema),
2300
2301
  legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
2301
2302
  plugins: optional(custom(() => true)),
@@ -3094,7 +3095,12 @@ function transformChunkModules(modules) {
3094
3095
  //#endregion
3095
3096
  //#region src/utils/bindingify-output-options.ts
3096
3097
  function bindingifyOutputOptions(outputOptions) {
3097
- 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
+ } }] };
3098
3104
  return {
3099
3105
  dir,
3100
3106
  file: file == null ? void 0 : file,
@@ -3122,7 +3128,7 @@ function bindingifyOutputOptions(outputOptions) {
3122
3128
  minify: outputOptions.minify,
3123
3129
  externalLiveBindings: outputOptions.externalLiveBindings,
3124
3130
  inlineDynamicImports: outputOptions.inlineDynamicImports,
3125
- advancedChunks: outputOptions.advancedChunks,
3131
+ advancedChunks,
3126
3132
  polyfillRequire: outputOptions.polyfillRequire,
3127
3133
  sanitizeFileName,
3128
3134
  preserveModules,
@@ -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.17";
30
+ var version = "1.0.0-beta.19";
31
31
 
32
32
  //#endregion
33
33
  //#region src/builtin-plugin/utils.ts
@@ -2344,6 +2344,7 @@ const InputOptionsSchema = strictObject({
2344
2344
  experimental: optional(strictObject({
2345
2345
  disableLiveBindings: optional(boolean()),
2346
2346
  enableComposingJsPlugins: optional(boolean()),
2347
+ viteMode: optional(boolean()),
2347
2348
  resolveNewUrlToAsset: optional(boolean()),
2348
2349
  strictExecutionOrder: optional(boolean()),
2349
2350
  hmr: optional(HmrSchema),
@@ -2423,7 +2424,7 @@ const AdvancedChunksSchema = strictObject({
2423
2424
  maxModuleSize: optional(number()),
2424
2425
  minShareCount: optional(number()),
2425
2426
  groups: optional(array(strictObject({
2426
- name: string(),
2427
+ name: union([string(), pipe(function_(), args(tuple([string()])), returns(nullish(string())))]),
2427
2428
  test: optional(union([
2428
2429
  string(),
2429
2430
  instance(RegExp),
@@ -2481,7 +2482,7 @@ const OutputOptionsSchema = strictObject({
2481
2482
  globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
2482
2483
  externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
2483
2484
  inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
2484
- 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())])))),
2485
2486
  advancedChunks: optional(AdvancedChunksSchema),
2486
2487
  legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
2487
2488
  plugins: optional(custom(() => true)),
@@ -2982,7 +2983,7 @@ function bindingPluginOrder(order) {
2982
2983
  }
2983
2984
 
2984
2985
  //#endregion
2985
- //#region ../../node_modules/.pnpm/oxc-parser@0.73.0/node_modules/oxc-parser/wrap.mjs
2986
+ //#region ../../node_modules/.pnpm/oxc-parser@0.73.2/node_modules/oxc-parser/wrap.mjs
2986
2987
  function wrap$1(result) {
2987
2988
  let program, module$1, comments, errors;
2988
2989
  return {
@@ -3419,7 +3420,12 @@ function transformChunkModules(modules) {
3419
3420
  //#endregion
3420
3421
  //#region src/utils/bindingify-output-options.ts
3421
3422
  function bindingifyOutputOptions(outputOptions) {
3422
- 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
+ } }] };
3423
3429
  return {
3424
3430
  dir,
3425
3431
  file: file == null ? void 0 : file,
@@ -3447,7 +3453,7 @@ function bindingifyOutputOptions(outputOptions) {
3447
3453
  minify: outputOptions.minify,
3448
3454
  externalLiveBindings: outputOptions.externalLiveBindings,
3449
3455
  inlineDynamicImports: outputOptions.inlineDynamicImports,
3450
- advancedChunks: outputOptions.advancedChunks,
3456
+ advancedChunks,
3451
3457
  polyfillRequire: outputOptions.polyfillRequire,
3452
3458
  sanitizeFileName,
3453
3459
  preserveModules,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolldown/browser",
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
  "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.0"
59
+ "@oxc-project/runtime": "=0.73.2"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "pnpm run build:debug",