rollup 3.7.6-0 → 3.8.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.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.7.6-0
4
- Sun, 18 Dec 2022 05:56:49 GMT - commit d226f7976dc543ff814af389e183d627d4e94ed4
3
+ Rollup.js v3.8.0
4
+ Thu, 22 Dec 2022 05:21:04 GMT - commit d750ef25d5b31bc21237963446c0a46789b8630b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -16,7 +16,7 @@ import { promises } from 'node:fs';
16
16
  import { EventEmitter } from 'node:events';
17
17
  import * as tty from 'tty';
18
18
 
19
- var version$1 = "3.7.6-0";
19
+ var version$1 = "3.8.0";
20
20
 
21
21
  var charToInteger = {};
22
22
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -11279,12 +11279,7 @@ class PrivateIdentifier extends NodeBase {
11279
11279
  class Program extends NodeBase {
11280
11280
  constructor() {
11281
11281
  super(...arguments);
11282
- this.hasCachedEffect = null;
11283
- }
11284
- hasCachedEffects() {
11285
- return this.hasCachedEffect === null
11286
- ? (this.hasCachedEffect = this.hasEffects(createHasEffectsContext()))
11287
- : this.hasCachedEffect;
11282
+ this.hasCachedEffect = false;
11288
11283
  }
11289
11284
  hasEffects(context) {
11290
11285
  // We are caching here to later more efficiently identify side-effect-free modules
@@ -13186,7 +13181,8 @@ class Module {
13186
13181
  return [null];
13187
13182
  }
13188
13183
  hasEffects() {
13189
- return this.info.moduleSideEffects === 'no-treeshake' || this.ast.hasCachedEffects();
13184
+ return (this.info.moduleSideEffects === 'no-treeshake' ||
13185
+ (this.ast.included && this.ast.hasEffects(createHasEffectsContext())));
13190
13186
  }
13191
13187
  include() {
13192
13188
  const context = createInclusionContext();
@@ -15123,12 +15119,17 @@ class Chunk {
15123
15119
  const renderedExports = exportMode === 'none' ? [] : this.getChunkExportDeclarations(format);
15124
15120
  let hasExports = renderedExports.length > 0;
15125
15121
  let hasDefaultExport = false;
15126
- for (const { reexports } of renderedDependencies) {
15122
+ for (const renderedDependence of renderedDependencies) {
15123
+ const { reexports } = renderedDependence;
15127
15124
  if (reexports?.length) {
15128
15125
  hasExports = true;
15129
- if (reexports.some(reexport => reexport.reexported === 'default')) {
15126
+ if (!hasDefaultExport && reexports.some(reexport => reexport.reexported === 'default')) {
15130
15127
  hasDefaultExport = true;
15131
- break;
15128
+ }
15129
+ if (format === 'es') {
15130
+ renderedDependence.reexports = reexports.filter(
15131
+ // eslint-disable-next-line unicorn/prefer-array-some
15132
+ ({ reexported }) => !renderedExports.find(({ exported }) => exported === reexported));
15132
15133
  }
15133
15134
  }
15134
15135
  }
@@ -15261,8 +15262,21 @@ class Chunk {
15261
15262
  const variable = this.exportsByName.get(exportName);
15262
15263
  if (!(variable instanceof SyntheticNamedExportVariable)) {
15263
15264
  const module = variable.module;
15264
- if (module && this.chunkByModule.get(module) !== this)
15265
- continue;
15265
+ if (module) {
15266
+ const chunk = this.chunkByModule.get(module);
15267
+ if (chunk !== this) {
15268
+ if (!chunk || format !== 'es') {
15269
+ continue;
15270
+ }
15271
+ const chunkDep = this.renderedDependencies.get(chunk);
15272
+ const { imports, reexports } = chunkDep;
15273
+ const importedByReexported = reexports?.find(({ reexported }) => reexported === exportName);
15274
+ const isImported = imports?.find(({ imported }) => imported === importedByReexported?.imported);
15275
+ if (!isImported) {
15276
+ continue;
15277
+ }
15278
+ }
15279
+ }
15266
15280
  }
15267
15281
  let expression = null;
15268
15282
  let hoisted = false;
@@ -15785,132 +15799,12 @@ function getImportedBindingsPerDependency(renderedDependencies, resolveFileName)
15785
15799
  const QUERY_HASH_REGEX = /[#?]/;
15786
15800
  const resolveFileName = (dependency) => dependency.getFileName();
15787
15801
 
15788
- const BYTE_UNITS = [
15789
- 'B',
15790
- 'kB',
15791
- 'MB',
15792
- 'GB',
15793
- 'TB',
15794
- 'PB',
15795
- 'EB',
15796
- 'ZB',
15797
- 'YB',
15798
- ];
15799
-
15800
- const BIBYTE_UNITS = [
15801
- 'B',
15802
- 'kiB',
15803
- 'MiB',
15804
- 'GiB',
15805
- 'TiB',
15806
- 'PiB',
15807
- 'EiB',
15808
- 'ZiB',
15809
- 'YiB',
15810
- ];
15811
-
15812
- const BIT_UNITS = [
15813
- 'b',
15814
- 'kbit',
15815
- 'Mbit',
15816
- 'Gbit',
15817
- 'Tbit',
15818
- 'Pbit',
15819
- 'Ebit',
15820
- 'Zbit',
15821
- 'Ybit',
15822
- ];
15823
-
15824
- const BIBIT_UNITS = [
15825
- 'b',
15826
- 'kibit',
15827
- 'Mibit',
15828
- 'Gibit',
15829
- 'Tibit',
15830
- 'Pibit',
15831
- 'Eibit',
15832
- 'Zibit',
15833
- 'Yibit',
15834
- ];
15835
-
15836
- /*
15837
- Formats the given number using `Number#toLocaleString`.
15838
- - If locale is a string, the value is expected to be a locale-key (for example: `de`).
15839
- - If locale is true, the system default locale is used for translation.
15840
- - If no value for locale is specified, the number is returned unmodified.
15841
- */
15842
- const toLocaleString = (number, locale, options) => {
15843
- let result = number;
15844
- if (typeof locale === 'string' || Array.isArray(locale)) {
15845
- result = number.toLocaleString(locale, options);
15846
- } else if (locale === true || options !== undefined) {
15847
- result = number.toLocaleString(undefined, options);
15848
- }
15849
-
15850
- return result;
15851
- };
15852
-
15853
- function prettyBytes(number, options) {
15854
- if (!Number.isFinite(number)) {
15855
- throw new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);
15856
- }
15857
-
15858
- options = {
15859
- bits: false,
15860
- binary: false,
15861
- ...options,
15862
- };
15863
-
15864
- const UNITS = options.bits
15865
- ? (options.binary ? BIBIT_UNITS : BIT_UNITS)
15866
- : (options.binary ? BIBYTE_UNITS : BYTE_UNITS);
15867
-
15868
- if (options.signed && number === 0) {
15869
- return ` 0 ${UNITS[0]}`;
15870
- }
15871
-
15872
- const isNegative = number < 0;
15873
- const prefix = isNegative ? '-' : (options.signed ? '+' : '');
15874
-
15875
- if (isNegative) {
15876
- number = -number;
15877
- }
15878
-
15879
- let localeOptions;
15880
-
15881
- if (options.minimumFractionDigits !== undefined) {
15882
- localeOptions = {minimumFractionDigits: options.minimumFractionDigits};
15883
- }
15884
-
15885
- if (options.maximumFractionDigits !== undefined) {
15886
- localeOptions = {maximumFractionDigits: options.maximumFractionDigits, ...localeOptions};
15887
- }
15888
-
15889
- if (number < 1) {
15890
- const numberString = toLocaleString(number, options.locale, localeOptions);
15891
- return prefix + numberString + ' ' + UNITS[0];
15892
- }
15893
-
15894
- const exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);
15895
- number /= (options.binary ? 1024 : 1000) ** exponent;
15896
-
15897
- if (!localeOptions) {
15898
- number = number.toPrecision(3);
15899
- }
15900
-
15901
- const numberString = toLocaleString(Number(number), options.locale, localeOptions);
15902
-
15903
- const unit = UNITS[exponent];
15904
-
15905
- return prefix + numberString + ' ' + unit;
15906
- }
15907
-
15908
15802
  /**
15909
15803
  * Concatenate a number of iterables to a new iterable without fully evaluating
15910
15804
  * their iterators. Useful when e.g. working with large sets or lists and when
15911
15805
  * there is a chance that the iterators will not be fully exhausted.
15912
15806
  */
15913
- function* concatLazy(iterables) {
15807
+ function* concatLazy(...iterables) {
15914
15808
  for (const iterable of iterables) {
15915
15809
  yield* iterable;
15916
15810
  }
@@ -16051,11 +15945,47 @@ function createChunks(allEntries, assignedEntriesByModule, minChunkSize) {
16051
15945
  alias: null,
16052
15946
  modules
16053
15947
  }))
16054
- : getOptimizedChunks(chunkModulesBySignature, minChunkSize).map(({ modules }) => ({
16055
- alias: null,
16056
- modules
16057
- }));
15948
+ : getOptimizedChunks(chunkModulesBySignature, minChunkSize);
16058
15949
  }
15950
+ function getOptimizedChunks(chunkModulesBySignature, minChunkSize) {
15951
+ timeStart('optimize chunks', 3);
15952
+ const { chunksToBeMerged, unmergeableChunks } = getMergeableChunks(chunkModulesBySignature, minChunkSize);
15953
+ for (const sourceChunk of chunksToBeMerged) {
15954
+ chunksToBeMerged.delete(sourceChunk);
15955
+ let closestChunk = null;
15956
+ let closestChunkDistance = Infinity;
15957
+ const { signature, size, modules } = sourceChunk;
15958
+ for (const targetChunk of concatLazy(chunksToBeMerged, unmergeableChunks)) {
15959
+ const distance = getSignatureDistance(signature, targetChunk.signature, !chunksToBeMerged.has(targetChunk));
15960
+ if (distance === 1) {
15961
+ closestChunk = targetChunk;
15962
+ break;
15963
+ }
15964
+ else if (distance < closestChunkDistance) {
15965
+ closestChunk = targetChunk;
15966
+ closestChunkDistance = distance;
15967
+ }
15968
+ }
15969
+ if (closestChunk) {
15970
+ closestChunk.modules.push(...modules);
15971
+ if (chunksToBeMerged.has(closestChunk)) {
15972
+ closestChunk.signature = mergeSignatures(signature, closestChunk.signature);
15973
+ if ((closestChunk.size += size) > minChunkSize) {
15974
+ chunksToBeMerged.delete(closestChunk);
15975
+ unmergeableChunks.push(closestChunk);
15976
+ }
15977
+ }
15978
+ }
15979
+ else {
15980
+ unmergeableChunks.push(sourceChunk);
15981
+ }
15982
+ }
15983
+ timeEnd('optimize chunks', 3);
15984
+ return unmergeableChunks;
15985
+ }
15986
+ const CHAR_DEPENDENT = 'X';
15987
+ const CHAR_INDEPENDENT = '_';
15988
+ const CHAR_CODE_DEPENDENT = CHAR_DEPENDENT.charCodeAt(0);
16059
15989
  function getChunkModulesBySignature(assignedEntriesByModule, allEntries) {
16060
15990
  const chunkModules = Object.create(null);
16061
15991
  for (const [module, assignedEntries] of assignedEntriesByModule) {
@@ -16073,205 +16003,28 @@ function getChunkModulesBySignature(assignedEntriesByModule, allEntries) {
16073
16003
  }
16074
16004
  return chunkModules;
16075
16005
  }
16076
- /**
16077
- * This function tries to get rid of small chunks by merging them with other
16078
- * chunks. In order to merge chunks, one must obey the following rule:
16079
- * - When merging several chunks, at most one of the chunks can have side
16080
- * effects
16081
- * - When one of the chunks has side effects, the entry points depending on that
16082
- * chunk need to be a super set of the entry points depending on the other
16083
- * chunks
16084
- * - Pure chunks can always be merged
16085
- * - We use the entry point dependence signature to calculate "chunk distance",
16086
- * i.e. how likely it is that two chunks are loaded together
16087
- */
16088
- function getOptimizedChunks(chunkModulesBySignature, minChunkSize) {
16089
- timeStart('optimize chunks', 3);
16090
- const chunkPartition = getPartitionedChunks(chunkModulesBySignature, minChunkSize);
16091
- console.log(`Created ${chunkPartition.big.pure.size +
16092
- chunkPartition.big.sideEffect.size +
16093
- chunkPartition.small.pure.size +
16094
- chunkPartition.small.sideEffect.size} chunks
16095
- ----- pure side effects
16096
- small ${`${chunkPartition.small.pure.size}`.padEnd(5, ' ')} ${chunkPartition.small.sideEffect.size}
16097
- big ${`${chunkPartition.big.pure.size}`.padEnd(5, ' ')} ${chunkPartition.big.sideEffect.size}
16098
- Unoptimized chunks contain ${getNumberOfCycles(chunkPartition)} cycles.
16099
- `);
16100
- if (chunkPartition.small.sideEffect.size > 0) {
16101
- console.log(`Trying to find merge targets for ${chunkPartition.small.sideEffect.size} chunks smaller than ${prettyBytes(minChunkSize)} with side effects...`);
16102
- mergeChunks(chunkPartition.small.sideEffect, [chunkPartition.small.pure, chunkPartition.big.pure], minChunkSize, chunkPartition);
16103
- console.log(`${chunkPartition.small.sideEffect.size} chunks smaller than ${prettyBytes(minChunkSize)} with side effects remaining.\nGenerated chunks contain ${getNumberOfCycles(chunkPartition)} cycles.\n`);
16104
- }
16105
- if (chunkPartition.small.pure.size > 0) {
16106
- console.log(`Trying to find merge targets for ${chunkPartition.small.pure.size} pure chunks smaller than ${prettyBytes(minChunkSize)}...`);
16107
- mergeChunks(chunkPartition.small.pure, [chunkPartition.small.pure, chunkPartition.big.sideEffect, chunkPartition.big.pure], minChunkSize, chunkPartition);
16108
- console.log(`${chunkPartition.small.pure.size} pure chunks smaller than ${prettyBytes(minChunkSize)} remaining.\nGenerated chunks contain ${getNumberOfCycles(chunkPartition)} cycles.\n`);
16109
- }
16110
- timeEnd('optimize chunks', 3);
16111
- const result = [
16112
- ...chunkPartition.small.sideEffect,
16113
- ...chunkPartition.small.pure,
16114
- ...chunkPartition.big.sideEffect,
16115
- ...chunkPartition.big.pure
16116
- ];
16117
- console.log(`${result.length} chunks remaining.`);
16118
- return result;
16119
- }
16120
- const CHAR_DEPENDENT = 'X';
16121
- const CHAR_INDEPENDENT = '_';
16122
- const CHAR_CODE_DEPENDENT = CHAR_DEPENDENT.charCodeAt(0);
16123
- function getPartitionedChunks(chunkModulesBySignature, minChunkSize) {
16124
- const smallPureChunks = [];
16125
- const bigPureChunks = [];
16126
- const smallSideEffectChunks = [];
16127
- const bigSideEffectChunks = [];
16128
- const chunkByModule = new Map();
16006
+ function getMergeableChunks(chunkModulesBySignature, minChunkSize) {
16007
+ const chunksToBeMerged = new Set();
16008
+ const unmergeableChunks = [];
16009
+ const alias = null;
16129
16010
  for (const [signature, modules] of Object.entries(chunkModulesBySignature)) {
16130
- const chunkDescription = {
16131
- dependencies: new Set(),
16132
- dependentChunks: new Set(),
16133
- modules,
16134
- pure: true,
16135
- signature,
16136
- size: 0
16137
- };
16138
16011
  let size = 0;
16139
- let pure = true;
16140
- for (const module of modules) {
16141
- chunkByModule.set(module, chunkDescription);
16142
- pure && (pure = !module.hasEffects());
16143
- // Unfortunately, we cannot take tree-shaking into account here because
16144
- // rendering did not happen yet
16145
- size += module.originalCode.length;
16146
- }
16147
- chunkDescription.pure = pure;
16148
- chunkDescription.size = size;
16149
- (size < minChunkSize
16150
- ? pure
16151
- ? smallPureChunks
16152
- : smallSideEffectChunks
16153
- : pure
16154
- ? bigPureChunks
16155
- : bigSideEffectChunks).push(chunkDescription);
16156
- }
16157
- sortChunksAndAddDependencies([bigPureChunks, bigSideEffectChunks, smallPureChunks, smallSideEffectChunks], chunkByModule);
16158
- return {
16159
- big: { pure: new Set(bigPureChunks), sideEffect: new Set(bigSideEffectChunks) },
16160
- small: { pure: new Set(smallPureChunks), sideEffect: new Set(smallSideEffectChunks) }
16161
- };
16162
- }
16163
- function getNumberOfCycles(partition) {
16164
- const parents = new Set();
16165
- const analysedChunks = new Set();
16166
- let cycles = 0;
16167
- const analyseChunk = (chunk) => {
16168
- for (const dependency of chunk.dependencies) {
16169
- if (parents.has(dependency)) {
16170
- if (!analysedChunks.has(dependency)) {
16171
- cycles++;
16172
- }
16173
- continue;
16174
- }
16175
- parents.add(dependency);
16176
- analyseChunk(dependency);
16177
- }
16178
- analysedChunks.add(chunk);
16179
- };
16180
- for (const chunk of [
16181
- ...partition.big.pure,
16182
- ...partition.big.sideEffect,
16183
- ...partition.small.pure,
16184
- ...partition.small.sideEffect
16185
- ]) {
16186
- if (!parents.has(chunk)) {
16187
- parents.add(chunk);
16188
- analyseChunk(chunk);
16189
- }
16190
- }
16191
- return cycles;
16192
- }
16193
- function sortChunksAndAddDependencies(chunkLists, chunkByModule) {
16194
- for (const chunks of chunkLists) {
16195
- chunks.sort(compareChunks);
16196
- for (const chunk of chunks) {
16197
- const { dependencies, modules } = chunk;
16012
+ checkModules: {
16198
16013
  for (const module of modules) {
16199
- for (const dependency of module.getDependenciesToBeIncluded()) {
16200
- const dependencyChunk = chunkByModule.get(dependency);
16201
- if (dependencyChunk && dependencyChunk !== chunk) {
16202
- dependencies.add(dependencyChunk);
16203
- dependencyChunk.dependentChunks.add(chunk);
16204
- }
16014
+ if (module.hasEffects()) {
16015
+ break checkModules;
16205
16016
  }
16206
- }
16207
- }
16208
- }
16209
- }
16210
- function compareChunks({ size: sizeA }, { size: sizeB }) {
16211
- return sizeA - sizeB;
16212
- }
16213
- function mergeChunks(chunksToBeMerged, targetChunks, minChunkSize, chunkPartition) {
16214
- for (const mergedChunk of chunksToBeMerged) {
16215
- let closestChunk = null;
16216
- let closestChunkDistance = Infinity;
16217
- const { signature, modules, pure, size } = mergedChunk;
16218
- for (const targetChunk of concatLazy(targetChunks)) {
16219
- if (mergedChunk === targetChunk)
16220
- continue;
16221
- const distance = pure
16222
- ? getSignatureDistance(signature, targetChunk.signature, !targetChunk.pure)
16223
- : getSignatureDistance(targetChunk.signature, signature, true);
16224
- if (distance < closestChunkDistance && isValidMerge(mergedChunk, targetChunk)) {
16225
- if (distance === 1) {
16226
- closestChunk = targetChunk;
16227
- break;
16017
+ size += module.magicString.toString().length;
16018
+ if (size > minChunkSize) {
16019
+ break checkModules;
16228
16020
  }
16229
- closestChunk = targetChunk;
16230
- closestChunkDistance = distance;
16231
16021
  }
16022
+ chunksToBeMerged.add({ alias, modules, signature, size });
16023
+ continue;
16232
16024
  }
16233
- if (closestChunk) {
16234
- chunksToBeMerged.delete(mergedChunk);
16235
- getChunksInPartition(closestChunk, minChunkSize, chunkPartition).delete(closestChunk);
16236
- closestChunk.modules.push(...modules);
16237
- closestChunk.size += size;
16238
- closestChunk.pure && (closestChunk.pure = pure);
16239
- closestChunk.signature = mergeSignatures(signature, closestChunk.signature);
16240
- const { dependencies, dependentChunks } = closestChunk;
16241
- for (const dependency of mergedChunk.dependencies) {
16242
- dependencies.add(dependency);
16243
- }
16244
- for (const dependentChunk of mergedChunk.dependentChunks) {
16245
- dependentChunks.add(dependentChunk);
16246
- dependentChunk.dependencies.delete(mergedChunk);
16247
- dependentChunk.dependencies.add(closestChunk);
16248
- }
16249
- dependencies.delete(closestChunk);
16250
- getChunksInPartition(closestChunk, minChunkSize, chunkPartition).add(closestChunk);
16251
- }
16252
- }
16253
- }
16254
- // Merging will not produce cycles if none of the direct non-merged dependencies
16255
- // of a chunk have the other chunk as a transitive dependency
16256
- function isValidMerge(mergedChunk, targetChunk) {
16257
- return !(hasTransitiveDependency(mergedChunk, targetChunk) ||
16258
- hasTransitiveDependency(targetChunk, mergedChunk));
16259
- }
16260
- function hasTransitiveDependency(dependentChunk, dependencyChunk) {
16261
- const chunksToCheck = new Set(dependentChunk.dependencies);
16262
- for (const { dependencies } of chunksToCheck) {
16263
- for (const dependency of dependencies) {
16264
- if (dependency === dependencyChunk) {
16265
- return true;
16266
- }
16267
- chunksToCheck.add(dependency);
16268
- }
16025
+ unmergeableChunks.push({ alias, modules, signature, size: null });
16269
16026
  }
16270
- return false;
16271
- }
16272
- function getChunksInPartition(chunk, minChunkSize, chunkPartition) {
16273
- const subPartition = chunk.size < minChunkSize ? chunkPartition.small : chunkPartition.big;
16274
- return chunk.pure ? subPartition.pure : subPartition.sideEffect;
16027
+ return { chunksToBeMerged, unmergeableChunks };
16275
16028
  }
16276
16029
  function getSignatureDistance(sourceSignature, targetSignature, enforceSubset) {
16277
16030
  let distance = 0;
@@ -23336,6 +23089,7 @@ class FileEmitter {
23336
23089
  this.facadeChunkByModule = null;
23337
23090
  this.nextIdBase = 1;
23338
23091
  this.output = null;
23092
+ this.outputFileEmitters = [];
23339
23093
  this.emitFile = (emittedFile) => {
23340
23094
  if (!hasValidType(emittedFile)) {
23341
23095
  return error(errorFailedValidation(`Emitted files must be of type "asset" or "chunk", received "${emittedFile && emittedFile.type}".`));
@@ -23379,6 +23133,9 @@ class FileEmitter {
23379
23133
  }
23380
23134
  else {
23381
23135
  consumedFile.source = source;
23136
+ for (const emitter of this.outputFileEmitters) {
23137
+ emitter.finalizeAsset(consumedFile, source, referenceId, emitter.output);
23138
+ }
23382
23139
  }
23383
23140
  };
23384
23141
  this.setChunkInformation = (facadeChunkByModule) => {
@@ -23401,6 +23158,10 @@ class FileEmitter {
23401
23158
  this.filesByReferenceId = baseFileEmitter
23402
23159
  ? new Map(baseFileEmitter.filesByReferenceId)
23403
23160
  : new Map();
23161
+ baseFileEmitter?.addOutputFileEmitter(this);
23162
+ }
23163
+ addOutputFileEmitter(outputFileEmitter) {
23164
+ this.outputFileEmitters.push(outputFileEmitter);
23404
23165
  }
23405
23166
  assignReferenceId(file, idBase) {
23406
23167
  let referenceId;
@@ -23409,8 +23170,12 @@ class FileEmitter {
23409
23170
  .update(referenceId || idBase)
23410
23171
  .digest('hex')
23411
23172
  .slice(0, 8);
23412
- } while (this.filesByReferenceId.has(referenceId));
23173
+ } while (this.filesByReferenceId.has(referenceId) ||
23174
+ this.outputFileEmitters.some(({ filesByReferenceId }) => filesByReferenceId.has(referenceId)));
23413
23175
  this.filesByReferenceId.set(referenceId, file);
23176
+ for (const { filesByReferenceId } of this.outputFileEmitters) {
23177
+ filesByReferenceId.set(referenceId, file);
23178
+ }
23414
23179
  return referenceId;
23415
23180
  }
23416
23181
  emitAsset(emittedAsset) {
@@ -23425,15 +23190,24 @@ class FileEmitter {
23425
23190
  };
23426
23191
  const referenceId = this.assignReferenceId(consumedAsset, emittedAsset.fileName || emittedAsset.name || String(this.nextIdBase++));
23427
23192
  if (this.output) {
23428
- if (emittedAsset.fileName) {
23429
- reserveFileNameInBundle(emittedAsset.fileName, this.output, this.options.onwarn);
23430
- }
23431
- if (source !== undefined) {
23432
- this.finalizeAsset(consumedAsset, source, referenceId, this.output);
23193
+ this.emitAssetWithReferenceId(consumedAsset, referenceId, this.output);
23194
+ }
23195
+ else {
23196
+ for (const fileEmitter of this.outputFileEmitters) {
23197
+ fileEmitter.emitAssetWithReferenceId(consumedAsset, referenceId, fileEmitter.output);
23433
23198
  }
23434
23199
  }
23435
23200
  return referenceId;
23436
23201
  }
23202
+ emitAssetWithReferenceId(consumedAsset, referenceId, output) {
23203
+ const { fileName, source } = consumedAsset;
23204
+ if (fileName) {
23205
+ reserveFileNameInBundle(fileName, output, this.options.onwarn);
23206
+ }
23207
+ if (source !== undefined) {
23208
+ this.finalizeAsset(consumedAsset, source, referenceId, output);
23209
+ }
23210
+ }
23437
23211
  emitChunk(emittedChunk) {
23438
23212
  if (this.graph.phase > BuildPhase.LOAD_AND_PARSE) {
23439
23213
  return error(errorInvalidRollupPhaseForChunkEmission());
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.7.6-0
4
- Sun, 18 Dec 2022 05:56:49 GMT - commit d226f7976dc543ff814af389e183d627d4e94ed4
3
+ Rollup.js v3.8.0
4
+ Thu, 22 Dec 2022 05:21:04 GMT - commit d750ef25d5b31bc21237963446c0a46789b8630b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.7.6-0
4
- Sun, 18 Dec 2022 05:56:49 GMT - commit d226f7976dc543ff814af389e183d627d4e94ed4
3
+ Rollup.js v3.8.0
4
+ Thu, 22 Dec 2022 05:21:04 GMT - commit d750ef25d5b31bc21237963446c0a46789b8630b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.7.6-0
4
- Sun, 18 Dec 2022 05:56:49 GMT - commit d226f7976dc543ff814af389e183d627d4e94ed4
3
+ Rollup.js v3.8.0
4
+ Thu, 22 Dec 2022 05:21:04 GMT - commit d750ef25d5b31bc21237963446c0a46789b8630b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.7.6-0
4
- Sun, 18 Dec 2022 05:56:49 GMT - commit d226f7976dc543ff814af389e183d627d4e94ed4
3
+ Rollup.js v3.8.0
4
+ Thu, 22 Dec 2022 05:21:04 GMT - commit d750ef25d5b31bc21237963446c0a46789b8630b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.7.6-0
4
- Sun, 18 Dec 2022 05:56:49 GMT - commit d226f7976dc543ff814af389e183d627d4e94ed4
3
+ Rollup.js v3.8.0
4
+ Thu, 22 Dec 2022 05:21:04 GMT - commit d750ef25d5b31bc21237963446c0a46789b8630b
5
5
 
6
6
  https://github.com/rollup/rollup
7
7