rollup 4.20.0 → 4.21.0

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.
package/dist/bin/rollup CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
3
  @license
4
- Rollup.js v4.20.0
5
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
4
+ Rollup.js v4.21.0
5
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
6
6
 
7
7
  https://github.com/rollup/rollup
8
8
 
@@ -1745,7 +1745,7 @@ else if (command.version) {
1745
1745
  }
1746
1746
  else {
1747
1747
  try {
1748
- // eslint-disable-next-line unicorn/prefer-module
1748
+ // eslint-disable-next-line unicorn/prefer-module, @typescript-eslint/no-require-imports
1749
1749
  require('source-map-support').install();
1750
1750
  }
1751
1751
  catch {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -16,7 +16,7 @@ import { performance } from 'node:perf_hooks';
16
16
  import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
17
17
  import * as tty from 'tty';
18
18
 
19
- var version = "4.20.0";
19
+ var version = "4.21.0";
20
20
 
21
21
  const comma = ','.charCodeAt(0);
22
22
  const semicolon = ';'.charCodeAt(0);
@@ -7414,7 +7414,9 @@ class ChildScope extends Scope {
7414
7414
  this.parent.addNamespaceMemberAccess(name, variable);
7415
7415
  }
7416
7416
  addReturnExpression(expression) {
7417
- this.parent instanceof ChildScope && this.parent.addReturnExpression(expression);
7417
+ if (this.parent instanceof ChildScope) {
7418
+ this.parent.addReturnExpression(expression);
7419
+ }
7418
7420
  }
7419
7421
  addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope) {
7420
7422
  for (const variable of this.accessedOutsideVariables.values()) {
@@ -7730,12 +7732,15 @@ function renderStatementList(statements, code, start, end, options) {
7730
7732
  currentNode.end +
7731
7733
  findFirstLineBreakOutsideComment(code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start))[1];
7732
7734
  if (currentNode.included) {
7733
- currentNodeNeedsBoundaries
7734
- ? currentNode.render(code, options, {
7735
+ if (currentNodeNeedsBoundaries) {
7736
+ currentNode.render(code, options, {
7735
7737
  end: nextNodeStart,
7736
7738
  start: currentNodeStart
7737
- })
7738
- : currentNode.render(code, options);
7739
+ });
7740
+ }
7741
+ else {
7742
+ currentNode.render(code, options);
7743
+ }
7739
7744
  }
7740
7745
  else {
7741
7746
  treeshakeNode(currentNode, code, currentNodeStart, nextNodeStart);
@@ -7929,7 +7934,9 @@ class RestElement extends NodeBase {
7929
7934
  return this.argument.declare(kind, UNKNOWN_EXPRESSION);
7930
7935
  }
7931
7936
  deoptimizePath(path) {
7932
- path.length === 0 && this.argument.deoptimizePath(EMPTY_PATH);
7937
+ if (path.length === 0) {
7938
+ this.argument.deoptimizePath(EMPTY_PATH);
7939
+ }
7933
7940
  }
7934
7941
  hasEffectsOnInteractionAtPath(path, interaction, context) {
7935
7942
  return (path.length > 0 ||
@@ -8384,7 +8391,9 @@ class AssignmentPattern extends NodeBase {
8384
8391
  return this.left.declare(kind, init);
8385
8392
  }
8386
8393
  deoptimizePath(path) {
8387
- path.length === 0 && this.left.deoptimizePath(path);
8394
+ if (path.length === 0) {
8395
+ this.left.deoptimizePath(path);
8396
+ }
8388
8397
  }
8389
8398
  hasEffectsOnInteractionAtPath(path, interaction, context) {
8390
8399
  return (path.length > 0 || this.left.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context));
@@ -11774,7 +11783,9 @@ class SwitchCase extends NodeBase {
11774
11783
  }
11775
11784
  render(code, options, nodeRenderOptions) {
11776
11785
  if (this.consequent.length > 0) {
11777
- this.test && this.test.render(code, options);
11786
+ if (this.test) {
11787
+ this.test.render(code, options);
11788
+ }
11778
11789
  const testEnd = this.test
11779
11790
  ? this.test.end
11780
11791
  : findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7;
@@ -13954,7 +13965,9 @@ class Module {
13954
13965
  ]);
13955
13966
  }
13956
13967
  error(properties, pos) {
13957
- pos !== undefined && this.addLocationToLogProps(properties, pos);
13968
+ if (pos !== undefined) {
13969
+ this.addLocationToLogProps(properties, pos);
13970
+ }
13958
13971
  return error(properties);
13959
13972
  }
13960
13973
  // sum up the length of all ast nodes that are included
@@ -15930,12 +15943,16 @@ const removeUnreferencedAssets = (outputBundle) => {
15930
15943
  const unreferencedAssets = new Set();
15931
15944
  const bundleEntries = Object.values(outputBundle);
15932
15945
  for (const asset of bundleEntries) {
15933
- asset.type === 'asset' && asset.needsCodeReference && unreferencedAssets.add(asset.fileName);
15946
+ if (asset.type === 'asset' && asset.needsCodeReference) {
15947
+ unreferencedAssets.add(asset.fileName);
15948
+ }
15934
15949
  }
15935
15950
  for (const chunk of bundleEntries) {
15936
15951
  if (chunk.type === 'chunk') {
15937
15952
  for (const referencedFile of chunk.referencedFiles) {
15938
- unreferencedAssets.has(referencedFile) && unreferencedAssets.delete(referencedFile);
15953
+ if (unreferencedAssets.has(referencedFile)) {
15954
+ unreferencedAssets.delete(referencedFile);
15955
+ }
15939
15956
  }
15940
15957
  }
15941
15958
  }
@@ -16382,7 +16399,9 @@ class Chunk {
16382
16399
  magicString.prepend(banner);
16383
16400
  if (format === 'es' || format === 'cjs') {
16384
16401
  const shebang = facadeModule !== null && facadeModule.info.isEntry && facadeModule.shebang;
16385
- shebang && magicString.prepend(`#!${shebang}\n`);
16402
+ if (shebang) {
16403
+ magicString.prepend(`#!${shebang}\n`);
16404
+ }
16386
16405
  }
16387
16406
  if (footer)
16388
16407
  magicString.append(footer);
@@ -16703,7 +16722,7 @@ class Chunk {
16703
16722
  : relative$1(this.inputBase, idWithoutExtension);
16704
16723
  }
16705
16724
  else {
16706
- return `_virtual/${basename(idWithoutExtension)}`;
16725
+ return (this.outputOptions.virtualDirname.replace(/\/$/, '') + '/' + basename(idWithoutExtension));
16707
16726
  }
16708
16727
  }
16709
16728
  getReexportSpecifiers() {
@@ -17542,11 +17561,13 @@ function getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, l
17542
17561
  timeEnd('optimize chunks', 3);
17543
17562
  return chunks; // the actual modules
17544
17563
  }
17545
- minChunkSize > 1 &&
17564
+ if (minChunkSize > 1) {
17546
17565
  log('info', logOptimizeChunkStatus(chunks.length, chunkPartition.small.size, 'Initially'));
17566
+ }
17547
17567
  mergeChunks(chunkPartition, minChunkSize, sideEffectAtoms, sizeByAtom);
17548
- minChunkSize > 1 &&
17568
+ if (minChunkSize > 1) {
17549
17569
  log('info', logOptimizeChunkStatus(chunkPartition.small.size + chunkPartition.big.size, chunkPartition.small.size, 'After merging chunks'));
17570
+ }
17550
17571
  timeEnd('optimize chunks', 3);
17551
17572
  return [...chunkPartition.small, ...chunkPartition.big];
17552
17573
  }
@@ -19888,7 +19909,7 @@ class PluginDriver {
19888
19909
  if (typeof handler !== 'function') {
19889
19910
  return handler;
19890
19911
  }
19891
- // eslint-disable-next-line @typescript-eslint/ban-types
19912
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
19892
19913
  const hookResult = handler.apply(context, parameters);
19893
19914
  if (!hookResult?.then) {
19894
19915
  // short circuit for non-thenables and non-Promises
@@ -19933,7 +19954,7 @@ class PluginDriver {
19933
19954
  context = replaceContext(context, plugin);
19934
19955
  }
19935
19956
  try {
19936
- // eslint-disable-next-line @typescript-eslint/ban-types
19957
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
19937
19958
  return handler.apply(context, parameters);
19938
19959
  }
19939
19960
  catch (error_) {
@@ -20495,7 +20516,8 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
20495
20516
  sourcemapPathTransform: config.sourcemapPathTransform,
20496
20517
  strict: config.strict ?? true,
20497
20518
  systemNullSetters: config.systemNullSetters ?? true,
20498
- validate: config.validate || false
20519
+ validate: config.validate || false,
20520
+ virtualDirname: config.virtualDirname || '_virtual'
20499
20521
  };
20500
20522
  warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onLog);
20501
20523
  return { options: outputOptions, unsetOptions };
@@ -21203,7 +21225,8 @@ async function mergeOutputOptions(config, overrides, log) {
21203
21225
  sourcemapPathTransform: getOption('sourcemapPathTransform'),
21204
21226
  strict: getOption('strict'),
21205
21227
  systemNullSetters: getOption('systemNullSetters'),
21206
- validate: getOption('validate')
21228
+ validate: getOption('validate'),
21229
+ virtualDirname: getOption('virtualDirname')
21207
21230
  };
21208
21231
  warnUnknownOptions(config, Object.keys(outputOptions), 'output options', log);
21209
21232
  return outputOptions;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/parseAst.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.d.ts CHANGED
@@ -227,6 +227,7 @@ export type ParseAst = (
227
227
 
228
228
  // declare AbortSignal here for environments without DOM lib or @types/node
229
229
  declare global {
230
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
230
231
  interface AbortSignal {}
231
232
  }
232
233
 
@@ -395,7 +396,6 @@ export type WatchChangeHook = (
395
396
  * const myPlugin: PluginImpl<Options> = (options = {}) => { ... }
396
397
  * ```
397
398
  */
398
- // eslint-disable-next-line @typescript-eslint/ban-types
399
399
  export type PluginImpl<O extends object = object, A = any> = (options?: O) => Plugin<A>;
400
400
 
401
401
  export interface OutputBundle {
@@ -505,13 +505,13 @@ type MakeAsync<Function_> = Function_ extends (
505
505
  ? (this: This, ...parameters: Arguments) => Return | Promise<Return>
506
506
  : never;
507
507
 
508
- // eslint-disable-next-line @typescript-eslint/ban-types
508
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
509
509
  type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O);
510
510
 
511
511
  export type PluginHooks = {
512
512
  [K in keyof FunctionPluginHooks]: ObjectHook<
513
513
  K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K],
514
- // eslint-disable-next-line @typescript-eslint/ban-types
514
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
515
515
  K extends ParallelPluginHooks ? { sequential?: boolean } : {}
516
516
  >;
517
517
  };
@@ -756,6 +756,7 @@ export interface OutputOptions {
756
756
  strict?: boolean;
757
757
  systemNullSetters?: boolean;
758
758
  validate?: boolean;
759
+ virtualDirname?: string;
759
760
  }
760
761
 
761
762
  export interface NormalizedOutputOptions {
@@ -809,6 +810,7 @@ export interface NormalizedOutputOptions {
809
810
  strict: boolean;
810
811
  systemNullSetters: boolean;
811
812
  validate: boolean;
813
+ virtualDirname: string;
812
814
  }
813
815
 
814
816
  export type WarningHandlerWithDefault = (
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -418,7 +418,7 @@ function getCamelizedPluginBaseName(pluginText) {
418
418
  }
419
419
  async function requireOrImport(pluginPath) {
420
420
  try {
421
- // eslint-disable-next-line unicorn/prefer-module
421
+ // eslint-disable-next-line unicorn/prefer-module, @typescript-eslint/no-require-imports
422
422
  return require(pluginPath);
423
423
  }
424
424
  catch {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -31,7 +31,7 @@ function _interopNamespaceDefault(e) {
31
31
 
32
32
  const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
33
33
 
34
- var version = "4.20.0";
34
+ var version = "4.21.0";
35
35
 
36
36
  function ensureArray$1(items) {
37
37
  if (Array.isArray(items)) {
@@ -165,12 +165,16 @@ const removeUnreferencedAssets = (outputBundle) => {
165
165
  const unreferencedAssets = new Set();
166
166
  const bundleEntries = Object.values(outputBundle);
167
167
  for (const asset of bundleEntries) {
168
- asset.type === 'asset' && asset.needsCodeReference && unreferencedAssets.add(asset.fileName);
168
+ if (asset.type === 'asset' && asset.needsCodeReference) {
169
+ unreferencedAssets.add(asset.fileName);
170
+ }
169
171
  }
170
172
  for (const chunk of bundleEntries) {
171
173
  if (chunk.type === 'chunk') {
172
174
  for (const referencedFile of chunk.referencedFiles) {
173
- unreferencedAssets.has(referencedFile) && unreferencedAssets.delete(referencedFile);
175
+ if (unreferencedAssets.has(referencedFile)) {
176
+ unreferencedAssets.delete(referencedFile);
177
+ }
174
178
  }
175
179
  }
176
180
  }
@@ -992,7 +996,7 @@ class PluginDriver {
992
996
  if (typeof handler !== 'function') {
993
997
  return handler;
994
998
  }
995
- // eslint-disable-next-line @typescript-eslint/ban-types
999
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
996
1000
  const hookResult = handler.apply(context, parameters);
997
1001
  if (!hookResult?.then) {
998
1002
  // short circuit for non-thenables and non-Promises
@@ -1037,7 +1041,7 @@ class PluginDriver {
1037
1041
  context = replaceContext(context, plugin);
1038
1042
  }
1039
1043
  try {
1040
- // eslint-disable-next-line @typescript-eslint/ban-types
1044
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
1041
1045
  return handler.apply(context, parameters);
1042
1046
  }
1043
1047
  catch (error_) {
@@ -1294,7 +1298,8 @@ async function mergeOutputOptions(config, overrides, log) {
1294
1298
  sourcemapPathTransform: getOption('sourcemapPathTransform'),
1295
1299
  strict: getOption('strict'),
1296
1300
  systemNullSetters: getOption('systemNullSetters'),
1297
- validate: getOption('validate')
1301
+ validate: getOption('validate'),
1302
+ virtualDirname: getOption('virtualDirname')
1298
1303
  };
1299
1304
  warnUnknownOptions(config, Object.keys(outputOptions), 'output options', log);
1300
1305
  return outputOptions;
@@ -8863,7 +8868,9 @@ class ChildScope extends Scope {
8863
8868
  this.parent.addNamespaceMemberAccess(name, variable);
8864
8869
  }
8865
8870
  addReturnExpression(expression) {
8866
- this.parent instanceof ChildScope && this.parent.addReturnExpression(expression);
8871
+ if (this.parent instanceof ChildScope) {
8872
+ this.parent.addReturnExpression(expression);
8873
+ }
8867
8874
  }
8868
8875
  addUsedOutsideNames(usedNames, format, exportNamesByVariable, accessedGlobalsByScope) {
8869
8876
  for (const variable of this.accessedOutsideVariables.values()) {
@@ -9179,12 +9186,15 @@ function renderStatementList(statements, code, start, end, options) {
9179
9186
  currentNode.end +
9180
9187
  findFirstLineBreakOutsideComment(code.original.slice(currentNode.end, nextNode === undefined ? end : nextNode.start))[1];
9181
9188
  if (currentNode.included) {
9182
- currentNodeNeedsBoundaries
9183
- ? currentNode.render(code, options, {
9189
+ if (currentNodeNeedsBoundaries) {
9190
+ currentNode.render(code, options, {
9184
9191
  end: nextNodeStart,
9185
9192
  start: currentNodeStart
9186
- })
9187
- : currentNode.render(code, options);
9193
+ });
9194
+ }
9195
+ else {
9196
+ currentNode.render(code, options);
9197
+ }
9188
9198
  }
9189
9199
  else {
9190
9200
  treeshakeNode(currentNode, code, currentNodeStart, nextNodeStart);
@@ -9378,7 +9388,9 @@ class RestElement extends NodeBase {
9378
9388
  return this.argument.declare(kind, UNKNOWN_EXPRESSION);
9379
9389
  }
9380
9390
  deoptimizePath(path) {
9381
- path.length === 0 && this.argument.deoptimizePath(EMPTY_PATH);
9391
+ if (path.length === 0) {
9392
+ this.argument.deoptimizePath(EMPTY_PATH);
9393
+ }
9382
9394
  }
9383
9395
  hasEffectsOnInteractionAtPath(path, interaction, context) {
9384
9396
  return (path.length > 0 ||
@@ -9833,7 +9845,9 @@ class AssignmentPattern extends NodeBase {
9833
9845
  return this.left.declare(kind, init);
9834
9846
  }
9835
9847
  deoptimizePath(path) {
9836
- path.length === 0 && this.left.deoptimizePath(path);
9848
+ if (path.length === 0) {
9849
+ this.left.deoptimizePath(path);
9850
+ }
9837
9851
  }
9838
9852
  hasEffectsOnInteractionAtPath(path, interaction, context) {
9839
9853
  return (path.length > 0 || this.left.hasEffectsOnInteractionAtPath(EMPTY_PATH, interaction, context));
@@ -13223,7 +13237,9 @@ class SwitchCase extends NodeBase {
13223
13237
  }
13224
13238
  render(code, options, nodeRenderOptions) {
13225
13239
  if (this.consequent.length > 0) {
13226
- this.test && this.test.render(code, options);
13240
+ if (this.test) {
13241
+ this.test.render(code, options);
13242
+ }
13227
13243
  const testEnd = this.test
13228
13244
  ? this.test.end
13229
13245
  : findFirstOccurrenceOutsideComment(code.original, 'default', this.start) + 7;
@@ -15396,7 +15412,9 @@ class Module {
15396
15412
  ]);
15397
15413
  }
15398
15414
  error(properties, pos) {
15399
- pos !== undefined && this.addLocationToLogProps(properties, pos);
15415
+ if (pos !== undefined) {
15416
+ this.addLocationToLogProps(properties, pos);
15417
+ }
15400
15418
  return parseAst_js.error(properties);
15401
15419
  }
15402
15420
  // sum up the length of all ast nodes that are included
@@ -17719,7 +17737,9 @@ class Chunk {
17719
17737
  magicString.prepend(banner);
17720
17738
  if (format === 'es' || format === 'cjs') {
17721
17739
  const shebang = facadeModule !== null && facadeModule.info.isEntry && facadeModule.shebang;
17722
- shebang && magicString.prepend(`#!${shebang}\n`);
17740
+ if (shebang) {
17741
+ magicString.prepend(`#!${shebang}\n`);
17742
+ }
17723
17743
  }
17724
17744
  if (footer)
17725
17745
  magicString.append(footer);
@@ -18040,7 +18060,7 @@ class Chunk {
18040
18060
  : parseAst_js.relative(this.inputBase, idWithoutExtension);
18041
18061
  }
18042
18062
  else {
18043
- return `_virtual/${path$2.basename(idWithoutExtension)}`;
18063
+ return (this.outputOptions.virtualDirname.replace(/\/$/, '') + '/' + path$2.basename(idWithoutExtension));
18044
18064
  }
18045
18065
  }
18046
18066
  getReexportSpecifiers() {
@@ -18879,11 +18899,13 @@ function getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, l
18879
18899
  timeEnd('optimize chunks', 3);
18880
18900
  return chunks; // the actual modules
18881
18901
  }
18882
- minChunkSize > 1 &&
18902
+ if (minChunkSize > 1) {
18883
18903
  log('info', parseAst_js.logOptimizeChunkStatus(chunks.length, chunkPartition.small.size, 'Initially'));
18904
+ }
18884
18905
  mergeChunks(chunkPartition, minChunkSize, sideEffectAtoms, sizeByAtom);
18885
- minChunkSize > 1 &&
18906
+ if (minChunkSize > 1) {
18886
18907
  log('info', parseAst_js.logOptimizeChunkStatus(chunkPartition.small.size + chunkPartition.big.size, chunkPartition.small.size, 'After merging chunks'));
18908
+ }
18887
18909
  timeEnd('optimize chunks', 3);
18888
18910
  return [...chunkPartition.small, ...chunkPartition.big];
18889
18911
  }
@@ -20889,7 +20911,8 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
20889
20911
  sourcemapPathTransform: config.sourcemapPathTransform,
20890
20912
  strict: config.strict ?? true,
20891
20913
  systemNullSetters: config.systemNullSetters ?? true,
20892
- validate: config.validate || false
20914
+ validate: config.validate || false,
20915
+ virtualDirname: config.virtualDirname || '_virtual'
20893
20916
  };
20894
20917
  warnUnknownOptions(config, Object.keys(outputOptions), 'output options', inputOptions.onLog);
20895
20918
  return { options: outputOptions, unsetOptions };
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.20.0
4
- Sat, 03 Aug 2024 04:48:21 GMT - commit df12edfea6e9c1a71bda1a01bed1ab787b7514d5
3
+ Rollup.js v4.21.0
4
+ Sun, 18 Aug 2024 05:55:06 GMT - commit c4bb050938778bcbe7b3b3ea3419f7fa70d60f5b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "4.20.0",
3
+ "version": "4.21.0",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -107,22 +107,22 @@
107
107
  "homepage": "https://rollupjs.org/",
108
108
  "optionalDependencies": {
109
109
  "fsevents": "~2.3.2",
110
- "@rollup/rollup-darwin-arm64": "4.20.0",
111
- "@rollup/rollup-android-arm64": "4.20.0",
112
- "@rollup/rollup-win32-arm64-msvc": "4.20.0",
113
- "@rollup/rollup-linux-arm64-gnu": "4.20.0",
114
- "@rollup/rollup-linux-arm64-musl": "4.20.0",
115
- "@rollup/rollup-android-arm-eabi": "4.20.0",
116
- "@rollup/rollup-linux-arm-gnueabihf": "4.20.0",
117
- "@rollup/rollup-linux-arm-musleabihf": "4.20.0",
118
- "@rollup/rollup-win32-ia32-msvc": "4.20.0",
119
- "@rollup/rollup-linux-riscv64-gnu": "4.20.0",
120
- "@rollup/rollup-linux-powerpc64le-gnu": "4.20.0",
121
- "@rollup/rollup-linux-s390x-gnu": "4.20.0",
122
- "@rollup/rollup-darwin-x64": "4.20.0",
123
- "@rollup/rollup-win32-x64-msvc": "4.20.0",
124
- "@rollup/rollup-linux-x64-gnu": "4.20.0",
125
- "@rollup/rollup-linux-x64-musl": "4.20.0"
110
+ "@rollup/rollup-darwin-arm64": "4.21.0",
111
+ "@rollup/rollup-android-arm64": "4.21.0",
112
+ "@rollup/rollup-win32-arm64-msvc": "4.21.0",
113
+ "@rollup/rollup-linux-arm64-gnu": "4.21.0",
114
+ "@rollup/rollup-linux-arm64-musl": "4.21.0",
115
+ "@rollup/rollup-android-arm-eabi": "4.21.0",
116
+ "@rollup/rollup-linux-arm-gnueabihf": "4.21.0",
117
+ "@rollup/rollup-linux-arm-musleabihf": "4.21.0",
118
+ "@rollup/rollup-win32-ia32-msvc": "4.21.0",
119
+ "@rollup/rollup-linux-riscv64-gnu": "4.21.0",
120
+ "@rollup/rollup-linux-powerpc64le-gnu": "4.21.0",
121
+ "@rollup/rollup-linux-s390x-gnu": "4.21.0",
122
+ "@rollup/rollup-darwin-x64": "4.21.0",
123
+ "@rollup/rollup-win32-x64-msvc": "4.21.0",
124
+ "@rollup/rollup-linux-x64-gnu": "4.21.0",
125
+ "@rollup/rollup-linux-x64-musl": "4.21.0"
126
126
  },
127
127
  "dependencies": {
128
128
  "@types/estree": "1.0.5"
@@ -137,7 +137,7 @@
137
137
  "@codemirror/language": "^6.10.2",
138
138
  "@codemirror/search": "^6.5.6",
139
139
  "@codemirror/state": "^6.4.1",
140
- "@codemirror/view": "^6.29.1",
140
+ "@codemirror/view": "^6.32.0",
141
141
  "@jridgewell/sourcemap-codec": "^1.5.0",
142
142
  "@mermaid-js/mermaid-cli": "^10.9.1",
143
143
  "@napi-rs/cli": "^2.18.4",
@@ -150,15 +150,15 @@
150
150
  "@rollup/plugin-terser": "^0.4.4",
151
151
  "@rollup/plugin-typescript": "^11.1.6",
152
152
  "@rollup/pluginutils": "^5.1.0",
153
- "@shikijs/vitepress-twoslash": "^1.12.0",
153
+ "@shikijs/vitepress-twoslash": "^1.12.1",
154
154
  "@types/eslint": "^8.56.11",
155
155
  "@types/inquirer": "^9.0.7",
156
156
  "@types/mocha": "^10.0.7",
157
157
  "@types/node": "~18.18.14",
158
158
  "@types/semver": "^7.5.8",
159
159
  "@types/yargs-parser": "^21.0.3",
160
- "@typescript-eslint/eslint-plugin": "^7.18.0",
161
- "@typescript-eslint/parser": "^7.18.0",
160
+ "@typescript-eslint/eslint-plugin": "^8.1.0",
161
+ "@typescript-eslint/parser": "^8.1.0",
162
162
  "@vue/eslint-config-prettier": "^9.0.0",
163
163
  "@vue/eslint-config-typescript": "^13.0.0",
164
164
  "acorn": "^8.12.1",
@@ -184,21 +184,21 @@
184
184
  "fs-extra": "^11.2.0",
185
185
  "github-api": "^3.4.0",
186
186
  "husky": "^9.1.4",
187
- "inquirer": "^10.1.5",
187
+ "inquirer": "^10.1.8",
188
188
  "is-reference": "^3.0.2",
189
- "lint-staged": "^15.2.7",
189
+ "lint-staged": "^15.2.8",
190
190
  "locate-character": "^3.0.0",
191
191
  "magic-string": "^0.30.11",
192
- "mocha": "^10.7.0",
192
+ "mocha": "^10.7.3",
193
193
  "nodemon": "^3.1.4",
194
194
  "npm-audit-resolver": "^3.0.0-RC.0",
195
195
  "nyc": "^17.0.0",
196
- "pinia": "^2.2.0",
196
+ "pinia": "^2.2.1",
197
197
  "prettier": "^3.3.3",
198
198
  "pretty-bytes": "^6.1.1",
199
199
  "pretty-ms": "^9.1.0",
200
200
  "requirejs": "^2.3.7",
201
- "rollup": "^4.19.1",
201
+ "rollup": "^4.20.0",
202
202
  "rollup-plugin-license": "^3.5.2",
203
203
  "rollup-plugin-string": "^3.0.0",
204
204
  "semver": "^7.6.3",
@@ -207,17 +207,17 @@
207
207
  "source-map": "^0.7.4",
208
208
  "source-map-support": "^0.5.21",
209
209
  "systemjs": "^6.15.1",
210
- "terser": "^5.31.3",
210
+ "terser": "^5.31.5",
211
211
  "tslib": "^2.6.3",
212
212
  "typescript": "^5.5.4",
213
- "vite": "^5.3.5",
214
- "vitepress": "^1.3.1",
215
- "vue": "^3.4.34",
213
+ "vite": "^5.4.0",
214
+ "vitepress": "^1.3.2",
215
+ "vue": "^3.4.37",
216
216
  "wasm-pack": "^0.13.0",
217
217
  "yargs-parser": "^21.1.1"
218
218
  },
219
219
  "overrides": {
220
- "axios": "^1.7.2",
220
+ "axios": "^1.7.3",
221
221
  "semver": "^7.6.3",
222
222
  "ws": "^8.18.0"
223
223
  },