@rollup/wasm-node 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
 
@@ -1,3 +1,4 @@
1
+
1
2
  let imports = {};
2
3
  imports['__wbindgen_placeholder__'] = module.exports;
3
4
  let wasm;
@@ -27,18 +28,18 @@ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true
27
28
 
28
29
  cachedTextDecoder.decode();
29
30
 
30
- let cachedUint8Memory0 = null;
31
+ let cachedUint8ArrayMemory0 = null;
31
32
 
32
- function getUint8Memory0() {
33
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
34
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
33
+ function getUint8ArrayMemory0() {
34
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
35
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
35
36
  }
36
- return cachedUint8Memory0;
37
+ return cachedUint8ArrayMemory0;
37
38
  }
38
39
 
39
40
  function getStringFromWasm0(ptr, len) {
40
41
  ptr = ptr >>> 0;
41
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
42
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
42
43
  }
43
44
 
44
45
  function addHeapObject(obj) {
@@ -72,7 +73,7 @@ function passStringToWasm0(arg, malloc, realloc) {
72
73
  if (realloc === undefined) {
73
74
  const buf = cachedTextEncoder.encode(arg);
74
75
  const ptr = malloc(buf.length, 1) >>> 0;
75
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
76
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
76
77
  WASM_VECTOR_LEN = buf.length;
77
78
  return ptr;
78
79
  }
@@ -80,7 +81,7 @@ function passStringToWasm0(arg, malloc, realloc) {
80
81
  let len = arg.length;
81
82
  let ptr = malloc(len, 1) >>> 0;
82
83
 
83
- const mem = getUint8Memory0();
84
+ const mem = getUint8ArrayMemory0();
84
85
 
85
86
  let offset = 0;
86
87
 
@@ -95,7 +96,7 @@ function passStringToWasm0(arg, malloc, realloc) {
95
96
  arg = arg.slice(offset);
96
97
  }
97
98
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
98
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
99
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
99
100
  const ret = encodeString(arg, view);
100
101
 
101
102
  offset += ret.written;
@@ -106,18 +107,18 @@ function passStringToWasm0(arg, malloc, realloc) {
106
107
  return ptr;
107
108
  }
108
109
 
109
- let cachedInt32Memory0 = null;
110
+ let cachedDataViewMemory0 = null;
110
111
 
111
- function getInt32Memory0() {
112
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
113
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
112
+ function getDataViewMemory0() {
113
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
114
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
114
115
  }
115
- return cachedInt32Memory0;
116
+ return cachedDataViewMemory0;
116
117
  }
117
118
 
118
119
  function getArrayU8FromWasm0(ptr, len) {
119
120
  ptr = ptr >>> 0;
120
- return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
121
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
121
122
  }
122
123
  /**
123
124
  * @param {string} code
@@ -130,8 +131,8 @@ module.exports.parse = function(code, allow_return_outside_function) {
130
131
  const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
131
132
  const len0 = WASM_VECTOR_LEN;
132
133
  wasm.parse(retptr, ptr0, len0, allow_return_outside_function);
133
- var r0 = getInt32Memory0()[retptr / 4 + 0];
134
- var r1 = getInt32Memory0()[retptr / 4 + 1];
134
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
135
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
135
136
  var v2 = getArrayU8FromWasm0(r0, r1).slice();
136
137
  wasm.__wbindgen_export_2(r0, r1 * 1, 1);
137
138
  return v2;
@@ -150,8 +151,8 @@ module.exports.xxhashBase64Url = function(input) {
150
151
  try {
151
152
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
152
153
  wasm.xxhashBase64Url(retptr, addHeapObject(input));
153
- var r0 = getInt32Memory0()[retptr / 4 + 0];
154
- var r1 = getInt32Memory0()[retptr / 4 + 1];
154
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
155
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
155
156
  deferred1_0 = r0;
156
157
  deferred1_1 = r1;
157
158
  return getStringFromWasm0(r0, r1);
@@ -171,8 +172,8 @@ module.exports.xxhashBase36 = function(input) {
171
172
  try {
172
173
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
173
174
  wasm.xxhashBase36(retptr, addHeapObject(input));
174
- var r0 = getInt32Memory0()[retptr / 4 + 0];
175
- var r1 = getInt32Memory0()[retptr / 4 + 1];
175
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
176
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
176
177
  deferred1_0 = r0;
177
178
  deferred1_1 = r1;
178
179
  return getStringFromWasm0(r0, r1);
@@ -192,8 +193,8 @@ module.exports.xxhashBase16 = function(input) {
192
193
  try {
193
194
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
194
195
  wasm.xxhashBase16(retptr, addHeapObject(input));
195
- var r0 = getInt32Memory0()[retptr / 4 + 0];
196
- var r1 = getInt32Memory0()[retptr / 4 + 1];
196
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
197
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
197
198
  deferred1_0 = r0;
198
199
  deferred1_1 = r1;
199
200
  return getStringFromWasm0(r0, r1);
@@ -274,12 +275,12 @@ module.exports.__wbg_getRandomValues_3aa56aa6edec874c = function() { return hand
274
275
  getObject(arg0).getRandomValues(getObject(arg1));
275
276
  }, arguments) };
276
277
 
277
- module.exports.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
278
+ module.exports.__wbg_newnoargs_76313bd6ff35d0f2 = function(arg0, arg1) {
278
279
  const ret = new Function(getStringFromWasm0(arg0, arg1));
279
280
  return addHeapObject(ret);
280
281
  };
281
282
 
282
- module.exports.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
283
+ module.exports.__wbg_call_1084a111329e68ce = function() { return handleError(function (arg0, arg1) {
283
284
  const ret = getObject(arg0).call(getObject(arg1));
284
285
  return addHeapObject(ret);
285
286
  }, arguments) };
@@ -289,22 +290,22 @@ module.exports.__wbindgen_object_clone_ref = function(arg0) {
289
290
  return addHeapObject(ret);
290
291
  };
291
292
 
292
- module.exports.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () {
293
+ module.exports.__wbg_self_3093d5d1f7bcb682 = function() { return handleError(function () {
293
294
  const ret = self.self;
294
295
  return addHeapObject(ret);
295
296
  }, arguments) };
296
297
 
297
- module.exports.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () {
298
+ module.exports.__wbg_window_3bcfc4d31bc012f8 = function() { return handleError(function () {
298
299
  const ret = window.window;
299
300
  return addHeapObject(ret);
300
301
  }, arguments) };
301
302
 
302
- module.exports.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () {
303
+ module.exports.__wbg_globalThis_86b222e13bdf32ed = function() { return handleError(function () {
303
304
  const ret = globalThis.globalThis;
304
305
  return addHeapObject(ret);
305
306
  }, arguments) };
306
307
 
307
- module.exports.__wbg_global_207b558942527489 = function() { return handleError(function () {
308
+ module.exports.__wbg_global_e5a3fe56f8be9485 = function() { return handleError(function () {
308
309
  const ret = global.global;
309
310
  return addHeapObject(ret);
310
311
  }, arguments) };
@@ -314,41 +315,41 @@ module.exports.__wbindgen_is_undefined = function(arg0) {
314
315
  return ret;
315
316
  };
316
317
 
317
- module.exports.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
318
+ module.exports.__wbg_call_89af060b4e1523f2 = function() { return handleError(function (arg0, arg1, arg2) {
318
319
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
319
320
  return addHeapObject(ret);
320
321
  }, arguments) };
321
322
 
322
- module.exports.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
323
+ module.exports.__wbg_buffer_b7b08af79b0b0974 = function(arg0) {
323
324
  const ret = getObject(arg0).buffer;
324
325
  return addHeapObject(ret);
325
326
  };
326
327
 
327
- module.exports.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
328
+ module.exports.__wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9 = function(arg0, arg1, arg2) {
328
329
  const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
329
330
  return addHeapObject(ret);
330
331
  };
331
332
 
332
- module.exports.__wbg_new_63b92bc8671ed464 = function(arg0) {
333
+ module.exports.__wbg_new_ea1883e1e5e86686 = function(arg0) {
333
334
  const ret = new Uint8Array(getObject(arg0));
334
335
  return addHeapObject(ret);
335
336
  };
336
337
 
337
- module.exports.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
338
+ module.exports.__wbg_set_d1e79e2388520f18 = function(arg0, arg1, arg2) {
338
339
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
339
340
  };
340
341
 
341
- module.exports.__wbg_length_c20a40f15020d68a = function(arg0) {
342
+ module.exports.__wbg_length_8339fcf5d8ecd12e = function(arg0) {
342
343
  const ret = getObject(arg0).length;
343
344
  return ret;
344
345
  };
345
346
 
346
- module.exports.__wbg_newwithlength_e9b4878cebadb3d3 = function(arg0) {
347
+ module.exports.__wbg_newwithlength_ec548f448387c968 = function(arg0) {
347
348
  const ret = new Uint8Array(arg0 >>> 0);
348
349
  return addHeapObject(ret);
349
350
  };
350
351
 
351
- module.exports.__wbg_subarray_a1f73cd4b5b42fe1 = function(arg0, arg1, arg2) {
352
+ module.exports.__wbg_subarray_7c2e3576afe181d1 = function(arg0, arg1, arg2) {
352
353
  const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
353
354
  return addHeapObject(ret);
354
355
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rollup/wasm-node",
3
- "version": "4.20.0",
3
+ "version": "4.21.0",
4
4
  "description": "Next-generation ES module bundler with Node wasm",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -38,7 +38,7 @@
38
38
  "@codemirror/language": "^6.10.2",
39
39
  "@codemirror/search": "^6.5.6",
40
40
  "@codemirror/state": "^6.4.1",
41
- "@codemirror/view": "^6.29.1",
41
+ "@codemirror/view": "^6.32.0",
42
42
  "@jridgewell/sourcemap-codec": "^1.5.0",
43
43
  "@mermaid-js/mermaid-cli": "^10.9.1",
44
44
  "@napi-rs/cli": "^2.18.4",
@@ -51,15 +51,15 @@
51
51
  "@rollup/plugin-terser": "^0.4.4",
52
52
  "@rollup/plugin-typescript": "^11.1.6",
53
53
  "@rollup/pluginutils": "^5.1.0",
54
- "@shikijs/vitepress-twoslash": "^1.12.0",
54
+ "@shikijs/vitepress-twoslash": "^1.12.1",
55
55
  "@types/eslint": "^8.56.11",
56
56
  "@types/inquirer": "^9.0.7",
57
57
  "@types/mocha": "^10.0.7",
58
58
  "@types/node": "~18.18.14",
59
59
  "@types/semver": "^7.5.8",
60
60
  "@types/yargs-parser": "^21.0.3",
61
- "@typescript-eslint/eslint-plugin": "^7.18.0",
62
- "@typescript-eslint/parser": "^7.18.0",
61
+ "@typescript-eslint/eslint-plugin": "^8.1.0",
62
+ "@typescript-eslint/parser": "^8.1.0",
63
63
  "@vue/eslint-config-prettier": "^9.0.0",
64
64
  "@vue/eslint-config-typescript": "^13.0.0",
65
65
  "acorn": "^8.12.1",
@@ -85,21 +85,21 @@
85
85
  "fs-extra": "^11.2.0",
86
86
  "github-api": "^3.4.0",
87
87
  "husky": "^9.1.4",
88
- "inquirer": "^10.1.5",
88
+ "inquirer": "^10.1.8",
89
89
  "is-reference": "^3.0.2",
90
- "lint-staged": "^15.2.7",
90
+ "lint-staged": "^15.2.8",
91
91
  "locate-character": "^3.0.0",
92
92
  "magic-string": "^0.30.11",
93
- "mocha": "^10.7.0",
93
+ "mocha": "^10.7.3",
94
94
  "nodemon": "^3.1.4",
95
95
  "npm-audit-resolver": "^3.0.0-RC.0",
96
96
  "nyc": "^17.0.0",
97
- "pinia": "^2.2.0",
97
+ "pinia": "^2.2.1",
98
98
  "prettier": "^3.3.3",
99
99
  "pretty-bytes": "^6.1.1",
100
100
  "pretty-ms": "^9.1.0",
101
101
  "requirejs": "^2.3.7",
102
- "rollup": "^4.19.1",
102
+ "rollup": "^4.20.0",
103
103
  "rollup-plugin-license": "^3.5.2",
104
104
  "rollup-plugin-string": "^3.0.0",
105
105
  "semver": "^7.6.3",
@@ -108,17 +108,17 @@
108
108
  "source-map": "^0.7.4",
109
109
  "source-map-support": "^0.5.21",
110
110
  "systemjs": "^6.15.1",
111
- "terser": "^5.31.3",
111
+ "terser": "^5.31.5",
112
112
  "tslib": "^2.6.3",
113
113
  "typescript": "^5.5.4",
114
- "vite": "^5.3.5",
115
- "vitepress": "^1.3.1",
116
- "vue": "^3.4.34",
114
+ "vite": "^5.4.0",
115
+ "vitepress": "^1.3.2",
116
+ "vue": "^3.4.37",
117
117
  "wasm-pack": "^0.13.0",
118
118
  "yargs-parser": "^21.1.1"
119
119
  },
120
120
  "overrides": {
121
- "axios": "^1.7.2",
121
+ "axios": "^1.7.3",
122
122
  "semver": "^7.6.3",
123
123
  "ws": "^8.18.0"
124
124
  },