rollup 3.28.1 → 3.29.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
@@ -2,8 +2,8 @@
2
2
 
3
3
  /*
4
4
  @license
5
- Rollup.js v3.28.1
6
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
5
+ Rollup.js v3.29.0
6
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
7
7
 
8
8
  https://github.com/rollup/rollup
9
9
 
@@ -28,7 +28,7 @@ require('node:crypto');
28
28
  require('node:url');
29
29
  require('../getLogFilter.js');
30
30
 
31
- const help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] <entry file>\n\nBasic options:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--amd.id <id> ID for AMD module (default is anonymous)\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--no-dynamicImportInCjs Write external dynamic CommonJS imports as require\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalImportAssertions Omit import assertions in \"es\" output\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--filterLogs <filter> Filter log messages\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--generatedCode.arrowFunctions Use arrow functions in generated code\n--generatedCode.constBindings Use \"const\" in generated code\n--generatedCode.objectShorthand Use shorthand properties in generated code\n--no-generatedCode.reservedNamesAsProps Always quote reserved names as props\n--generatedCode.symbols Use symbols in generated code\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--no-indent Don't indent result\n--inlineDynamicImports Create single bundle when using dynamic imports\n--no-interop Do not include interop block\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--logLevel <level> Which kind of logs to display\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileOps <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--no-systemNullSetters Do not replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared\n--treeshake.manualPureFunctions <names> Manually declare functions as pure\n--no-treeshake.moduleSideEffects Assume modules have no side effects\n--no-treeshake.propertyReadSideEffects Ignore property access side effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--validate Validate output\n--waitForBundleInput Wait for bundle input files\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.skipWrite Do not write files to disk when watching\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n";
31
+ const help = "rollup version __VERSION__\n=====================================\n\nUsage: rollup [options] <entry file>\n\nBasic options:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, defaults to rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--amd.id <id> ID for AMD module (default is anonymous)\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--no-dynamicImportInCjs Write external dynamic CommonJS imports as require\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalImportAssertions Omit import assertions in \"es\" output\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--filterLogs <filter> Filter log messages\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--generatedCode.arrowFunctions Use arrow functions in generated code\n--generatedCode.constBindings Use \"const\" in generated code\n--generatedCode.objectShorthand Use shorthand properties in generated code\n--no-generatedCode.reservedNamesAsProps Always quote reserved names as props\n--generatedCode.symbols Use symbols in generated code\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--no-indent Don't indent result\n--inlineDynamicImports Create single bundle when using dynamic imports\n--no-interop Do not include interop block\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--logLevel <level> Which kind of logs to display\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileOps <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--sourcemapFileNames <pattern> Name pattern for emitted sourcemaps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--no-systemNullSetters Do not replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared\n--treeshake.manualPureFunctions <names> Manually declare functions as pure\n--no-treeshake.moduleSideEffects Assume modules have no side effects\n--no-treeshake.propertyReadSideEffects Ignore property access side effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--validate Validate output\n--waitForBundleInput Wait for bundle input files\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.skipWrite Do not write files to disk when watching\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n";
32
32
 
33
33
  /**
34
34
  * @license
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
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 v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -15,7 +15,7 @@ import { createHash as createHash$1 } from 'node:crypto';
15
15
  import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
16
16
  import * as tty from 'tty';
17
17
 
18
- var version$1 = "3.28.1";
18
+ var version$1 = "3.29.0";
19
19
 
20
20
  const comma = ','.charCodeAt(0);
21
21
  const semicolon = ';'.charCodeAt(0);
@@ -7713,7 +7713,17 @@ const knownGlobals = {
7713
7713
  CSSSupportsRule: C,
7714
7714
  CustomElementRegistry: C,
7715
7715
  customElements: O,
7716
- CustomEvent: C,
7716
+ CustomEvent: {
7717
+ __proto__: null,
7718
+ [ValueProperties]: {
7719
+ deoptimizeArgumentsOnCall({ args }) {
7720
+ args[2]?.deoptimizePath(['detail']);
7721
+ },
7722
+ getLiteralValue: getTruthyLiteralValue,
7723
+ hasEffectsWhenCalled: returnFalse
7724
+ },
7725
+ prototype: O
7726
+ },
7717
7727
  DataTransfer: C,
7718
7728
  DataTransferItem: C,
7719
7729
  DataTransferItemList: C,
@@ -15716,6 +15726,7 @@ class Chunk {
15716
15726
  this.needsExportsShim = false;
15717
15727
  this.preRenderedChunkInfo = null;
15718
15728
  this.preliminaryFileName = null;
15729
+ this.preliminarySourcemapFileName = null;
15719
15730
  this.renderedChunkInfo = null;
15720
15731
  this.renderedDependencies = null;
15721
15732
  this.renderedModules = Object.create(null);
@@ -15790,7 +15801,7 @@ class Chunk {
15790
15801
  }
15791
15802
  return true;
15792
15803
  }
15793
- finalizeChunk(code, map, hashesByPlaceholder) {
15804
+ finalizeChunk(code, map, sourcemapFileName, hashesByPlaceholder) {
15794
15805
  const renderedChunkInfo = this.getRenderedChunkInfo();
15795
15806
  const finalize = (code) => replacePlaceholders(code, hashesByPlaceholder);
15796
15807
  const preliminaryFileName = renderedChunkInfo.fileName;
@@ -15808,7 +15819,8 @@ class Chunk {
15808
15819
  imports: renderedChunkInfo.imports.map(finalize),
15809
15820
  map,
15810
15821
  preliminaryFileName,
15811
- referencedFiles: renderedChunkInfo.referencedFiles.map(finalize)
15822
+ referencedFiles: renderedChunkInfo.referencedFiles.map(finalize),
15823
+ sourcemapFileName
15812
15824
  };
15813
15825
  }
15814
15826
  generateExports() {
@@ -15949,6 +15961,30 @@ class Chunk {
15949
15961
  // Caching is essential to not conflict with the file name reservation above
15950
15962
  return (this.preliminaryFileName = { fileName, hashPlaceholder });
15951
15963
  }
15964
+ getPreliminarySourcemapFileName() {
15965
+ if (this.preliminarySourcemapFileName) {
15966
+ return this.preliminarySourcemapFileName;
15967
+ }
15968
+ let sourcemapFileName = null;
15969
+ let hashPlaceholder = null;
15970
+ const { sourcemapFileNames, format } = this.outputOptions;
15971
+ if (sourcemapFileNames) {
15972
+ const [pattern, patternName] = [sourcemapFileNames, 'output.sourcemapFileNames'];
15973
+ sourcemapFileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
15974
+ chunkhash: () => this.getPreliminaryFileName().hashPlaceholder || '',
15975
+ format: () => format,
15976
+ hash: size => hashPlaceholder || (hashPlaceholder = this.getPlaceholder(patternName, size)),
15977
+ name: () => this.getChunkName()
15978
+ });
15979
+ if (!hashPlaceholder) {
15980
+ sourcemapFileName = makeUnique(sourcemapFileName, this.bundle);
15981
+ }
15982
+ }
15983
+ else {
15984
+ return null;
15985
+ }
15986
+ return (this.preliminarySourcemapFileName = { fileName: sourcemapFileName, hashPlaceholder });
15987
+ }
15952
15988
  getRenderedChunkInfo() {
15953
15989
  if (this.renderedChunkInfo) {
15954
15990
  return this.renderedChunkInfo;
@@ -15991,6 +16027,7 @@ class Chunk {
15991
16027
  }
15992
16028
  }
15993
16029
  const preliminaryFileName = this.getPreliminaryFileName();
16030
+ const preliminarySourcemapFileName = this.getPreliminarySourcemapFileName();
15994
16031
  const { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait } = this.renderModules(preliminaryFileName.fileName);
15995
16032
  const renderedDependencies = [...this.getRenderedDependencies().values()];
15996
16033
  const renderedExports = exportMode === 'none' ? [] : this.getChunkExportDeclarations(format);
@@ -16044,6 +16081,7 @@ class Chunk {
16044
16081
  chunk: this,
16045
16082
  magicString,
16046
16083
  preliminaryFileName,
16084
+ preliminarySourcemapFileName,
16047
16085
  usedModules
16048
16086
  };
16049
16087
  }
@@ -17619,8 +17657,8 @@ async function renderChunks(chunks, bundle, pluginDriver, outputOptions, log) {
17619
17657
  timeEnd('render chunks', 2);
17620
17658
  timeStart('transform chunks', 2);
17621
17659
  const chunkGraph = getChunkGraph(chunks);
17622
- const { nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder, hashDependenciesByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, log);
17623
- const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, bundle);
17660
+ const { initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder, hashDependenciesByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, log);
17661
+ const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle);
17624
17662
  addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, outputOptions);
17625
17663
  timeEnd('transform chunks', 2);
17626
17664
  }
@@ -17704,18 +17742,20 @@ async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGrap
17704
17742
  const nonHashedChunksWithPlaceholders = [];
17705
17743
  const renderedChunksByPlaceholder = new Map();
17706
17744
  const hashDependenciesByPlaceholder = new Map();
17745
+ const initialHashesByPlaceholder = new Map();
17707
17746
  const placeholders = new Set();
17708
17747
  for (const { preliminaryFileName: { hashPlaceholder } } of renderedChunks) {
17709
17748
  if (hashPlaceholder)
17710
17749
  placeholders.add(hashPlaceholder);
17711
17750
  }
17712
- await Promise.all(renderedChunks.map(async ({ chunk, preliminaryFileName: { fileName, hashPlaceholder }, magicString, usedModules }) => {
17751
+ await Promise.all(renderedChunks.map(async ({ chunk, preliminaryFileName: { fileName, hashPlaceholder }, preliminarySourcemapFileName, magicString, usedModules }) => {
17713
17752
  const transformedChunk = {
17714
17753
  chunk,
17715
17754
  fileName,
17755
+ sourcemapFileName: preliminarySourcemapFileName?.fileName ?? null,
17716
17756
  ...(await transformChunk(magicString, fileName, usedModules, chunkGraph, outputOptions, pluginDriver, log))
17717
17757
  };
17718
- const { code } = transformedChunk;
17758
+ const { code, map } = transformedChunk;
17719
17759
  if (hashPlaceholder) {
17720
17760
  // To create a reproducible content-only hash, all placeholders are
17721
17761
  // replaced with the same value before hashing
@@ -17739,15 +17779,23 @@ async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGrap
17739
17779
  else {
17740
17780
  nonHashedChunksWithPlaceholders.push(transformedChunk);
17741
17781
  }
17782
+ const sourcemapHashPlaceholder = preliminarySourcemapFileName?.hashPlaceholder;
17783
+ if (map && sourcemapHashPlaceholder) {
17784
+ initialHashesByPlaceholder.set(preliminarySourcemapFileName.hashPlaceholder, createHash()
17785
+ .update(map.toString())
17786
+ .digest('hex')
17787
+ .slice(0, preliminarySourcemapFileName.hashPlaceholder.length));
17788
+ }
17742
17789
  }));
17743
17790
  return {
17744
17791
  hashDependenciesByPlaceholder,
17792
+ initialHashesByPlaceholder,
17745
17793
  nonHashedChunksWithPlaceholders,
17746
17794
  renderedChunksByPlaceholder
17747
17795
  };
17748
17796
  }
17749
- function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, bundle) {
17750
- const hashesByPlaceholder = new Map();
17797
+ function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle) {
17798
+ const hashesByPlaceholder = new Map(initialHashesByPlaceholder);
17751
17799
  for (const [placeholder, { fileName }] of renderedChunksByPlaceholder) {
17752
17800
  let hash = createHash();
17753
17801
  const hashDependencyPlaceholders = new Set([placeholder]);
@@ -17775,21 +17823,29 @@ function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlac
17775
17823
  return hashesByPlaceholder;
17776
17824
  }
17777
17825
  function addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, options) {
17778
- for (const { chunk, code, fileName, map } of renderedChunksByPlaceholder.values()) {
17826
+ for (const { chunk, code, fileName, sourcemapFileName, map } of renderedChunksByPlaceholder.values()) {
17779
17827
  let updatedCode = replacePlaceholders(code, hashesByPlaceholder);
17780
17828
  const finalFileName = replacePlaceholders(fileName, hashesByPlaceholder);
17829
+ let finalSourcemapFileName = null;
17781
17830
  if (map) {
17831
+ finalSourcemapFileName = sourcemapFileName
17832
+ ? replacePlaceholders(sourcemapFileName, hashesByPlaceholder)
17833
+ : `${finalFileName}.map`;
17782
17834
  map.file = replacePlaceholders(map.file, hashesByPlaceholder);
17783
- updatedCode += emitSourceMapAndGetComment(finalFileName, map, pluginDriver, options);
17835
+ updatedCode += emitSourceMapAndGetComment(finalSourcemapFileName, map, pluginDriver, options);
17784
17836
  }
17785
- bundle[finalFileName] = chunk.finalizeChunk(updatedCode, map, hashesByPlaceholder);
17837
+ bundle[finalFileName] = chunk.finalizeChunk(updatedCode, map, finalSourcemapFileName, hashesByPlaceholder);
17786
17838
  }
17787
- for (const { chunk, code, fileName, map } of nonHashedChunksWithPlaceholders) {
17839
+ for (const { chunk, code, fileName, sourcemapFileName, map } of nonHashedChunksWithPlaceholders) {
17788
17840
  let updatedCode = hashesByPlaceholder.size > 0 ? replacePlaceholders(code, hashesByPlaceholder) : code;
17841
+ let finalSourcemapFileName = null;
17789
17842
  if (map) {
17790
- updatedCode += emitSourceMapAndGetComment(fileName, map, pluginDriver, options);
17843
+ finalSourcemapFileName = sourcemapFileName
17844
+ ? replacePlaceholders(sourcemapFileName, hashesByPlaceholder)
17845
+ : `${fileName}.map`;
17846
+ updatedCode += emitSourceMapAndGetComment(finalSourcemapFileName, map, pluginDriver, options);
17791
17847
  }
17792
- bundle[fileName] = chunk.finalizeChunk(updatedCode, map, hashesByPlaceholder);
17848
+ bundle[fileName] = chunk.finalizeChunk(updatedCode, map, finalSourcemapFileName, hashesByPlaceholder);
17793
17849
  }
17794
17850
  }
17795
17851
  function emitSourceMapAndGetComment(fileName, map, pluginDriver, { sourcemap, sourcemapBaseUrl }) {
@@ -17798,11 +17854,11 @@ function emitSourceMapAndGetComment(fileName, map, pluginDriver, { sourcemap, so
17798
17854
  url = map.toUrl();
17799
17855
  }
17800
17856
  else {
17801
- const sourcemapFileName = `${basename(fileName)}.map`;
17857
+ const sourcemapFileName = basename(fileName);
17802
17858
  url = sourcemapBaseUrl
17803
17859
  ? new URL(sourcemapFileName, sourcemapBaseUrl).toString()
17804
17860
  : sourcemapFileName;
17805
- pluginDriver.emitFile({ fileName: `${fileName}.map`, source: map.toString(), type: 'asset' });
17861
+ pluginDriver.emitFile({ fileName, source: map.toString(), type: 'asset' });
17806
17862
  }
17807
17863
  return sourcemap === 'hidden' ? '' : `//# ${SOURCEMAPPING_URL}=${url}\n`;
17808
17864
  }
@@ -25073,6 +25129,7 @@ class FileEmitter {
25073
25129
  name: prebuiltChunk.fileName,
25074
25130
  preliminaryFileName: prebuiltChunk.fileName,
25075
25131
  referencedFiles: [],
25132
+ sourcemapFileName: prebuiltChunk.sourcemapFileName || null,
25076
25133
  type: 'chunk'
25077
25134
  };
25078
25135
  }
@@ -26355,6 +26412,7 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
26355
26412
  sourcemapBaseUrl: getSourcemapBaseUrl(config),
26356
26413
  sourcemapExcludeSources: config.sourcemapExcludeSources || false,
26357
26414
  sourcemapFile: config.sourcemapFile,
26415
+ sourcemapFileNames: getSourcemapFileNames(config, unsetOptions),
26358
26416
  sourcemapIgnoreList: typeof config.sourcemapIgnoreList === 'function'
26359
26417
  ? config.sourcemapIgnoreList
26360
26418
  : config.sourcemapIgnoreList === false
@@ -26583,6 +26641,13 @@ const getNamespaceToStringTag = (config, generatedCode, inputOptions) => {
26583
26641
  }
26584
26642
  return generatedCode.symbols || false;
26585
26643
  };
26644
+ const getSourcemapFileNames = (config, unsetOptions) => {
26645
+ const configSourcemapFileNames = config.sourcemapFileNames;
26646
+ if (configSourcemapFileNames == null) {
26647
+ unsetOptions.add('sourcemapFileNames');
26648
+ }
26649
+ return configSourcemapFileNames;
26650
+ };
26586
26651
  const getSourcemapBaseUrl = (config) => {
26587
26652
  const { sourcemapBaseUrl } = config;
26588
26653
  if (sourcemapBaseUrl) {
@@ -27074,6 +27139,7 @@ async function mergeOutputOptions(config, overrides, log) {
27074
27139
  sourcemapBaseUrl: getOption('sourcemapBaseUrl'),
27075
27140
  sourcemapExcludeSources: getOption('sourcemapExcludeSources'),
27076
27141
  sourcemapFile: getOption('sourcemapFile'),
27142
+ sourcemapFileNames: getOption('sourcemapFileNames'),
27077
27143
  sourcemapIgnoreList: getOption('sourcemapIgnoreList'),
27078
27144
  sourcemapPathTransform: getOption('sourcemapPathTransform'),
27079
27145
  strict: getOption('strict'),
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.d.ts CHANGED
@@ -164,6 +164,7 @@ export interface EmittedPrebuiltChunk {
164
164
  exports?: string[];
165
165
  fileName: string;
166
166
  map?: SourceMap;
167
+ sourcemapFileName?: string;
167
168
  type: 'prebuilt-chunk';
168
169
  }
169
170
 
@@ -369,7 +370,7 @@ export type WatchChangeHook = (
369
370
  * ```
370
371
  */
371
372
  // eslint-disable-next-line @typescript-eslint/ban-types
372
- export type PluginImpl<O extends object = object> = (options?: O) => Plugin;
373
+ export type PluginImpl<O extends object = object, A = any> = (options?: O) => Plugin<A>;
373
374
 
374
375
  export interface OutputBundle {
375
376
  [fileName: string]: OutputAsset | OutputChunk;
@@ -497,9 +498,9 @@ export interface OutputPlugin
497
498
  version?: string;
498
499
  }
499
500
 
500
- export interface Plugin extends OutputPlugin, Partial<PluginHooks> {
501
+ export interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
501
502
  // for inter-plugin communication
502
- api?: any;
503
+ api?: A;
503
504
  }
504
505
 
505
506
  type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
@@ -744,6 +745,7 @@ export interface OutputOptions {
744
745
  sourcemapBaseUrl?: string;
745
746
  sourcemapExcludeSources?: boolean;
746
747
  sourcemapFile?: string;
748
+ sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
747
749
  sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
748
750
  sourcemapPathTransform?: SourcemapPathTransformOption;
749
751
  strict?: boolean;
@@ -799,6 +801,7 @@ export interface NormalizedOutputOptions {
799
801
  sourcemapBaseUrl: string | undefined;
800
802
  sourcemapExcludeSources: boolean;
801
803
  sourcemapFile: string | undefined;
804
+ sourcemapFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
802
805
  sourcemapIgnoreList: SourcemapIgnoreListOption;
803
806
  sourcemapPathTransform: SourcemapPathTransformOption | undefined;
804
807
  strict: boolean;
@@ -862,6 +865,7 @@ export interface RenderedChunk extends PreRenderedChunk {
862
865
  export interface OutputChunk extends RenderedChunk {
863
866
  code: string;
864
867
  map: SourceMap | null;
868
+ sourcemapFileName: string | null;
865
869
  preliminaryFileName: string;
866
870
  }
867
871
 
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -30,7 +30,7 @@ function _interopNamespaceDefault(e) {
30
30
 
31
31
  const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
32
32
 
33
- var version$1 = "3.28.1";
33
+ var version$1 = "3.29.0";
34
34
 
35
35
  function ensureArray$1(items) {
36
36
  if (Array.isArray(items)) {
@@ -1284,6 +1284,7 @@ class FileEmitter {
1284
1284
  name: prebuiltChunk.fileName,
1285
1285
  preliminaryFileName: prebuiltChunk.fileName,
1286
1286
  referencedFiles: [],
1287
+ sourcemapFileName: prebuiltChunk.sourcemapFileName || null,
1287
1288
  type: 'chunk'
1288
1289
  };
1289
1290
  }
@@ -2210,6 +2211,7 @@ async function mergeOutputOptions(config, overrides, log) {
2210
2211
  sourcemapBaseUrl: getOption('sourcemapBaseUrl'),
2211
2212
  sourcemapExcludeSources: getOption('sourcemapExcludeSources'),
2212
2213
  sourcemapFile: getOption('sourcemapFile'),
2214
+ sourcemapFileNames: getOption('sourcemapFileNames'),
2213
2215
  sourcemapIgnoreList: getOption('sourcemapIgnoreList'),
2214
2216
  sourcemapPathTransform: getOption('sourcemapPathTransform'),
2215
2217
  strict: getOption('strict'),
@@ -9210,7 +9212,17 @@ const knownGlobals = {
9210
9212
  CSSSupportsRule: C,
9211
9213
  CustomElementRegistry: C,
9212
9214
  customElements: O,
9213
- CustomEvent: C,
9215
+ CustomEvent: {
9216
+ __proto__: null,
9217
+ [ValueProperties]: {
9218
+ deoptimizeArgumentsOnCall({ args }) {
9219
+ args[2]?.deoptimizePath(['detail']);
9220
+ },
9221
+ getLiteralValue: getTruthyLiteralValue,
9222
+ hasEffectsWhenCalled: returnFalse
9223
+ },
9224
+ prototype: O
9225
+ },
9214
9226
  DataTransfer: C,
9215
9227
  DataTransferItem: C,
9216
9228
  DataTransferItemList: C,
@@ -17101,6 +17113,7 @@ class Chunk {
17101
17113
  this.needsExportsShim = false;
17102
17114
  this.preRenderedChunkInfo = null;
17103
17115
  this.preliminaryFileName = null;
17116
+ this.preliminarySourcemapFileName = null;
17104
17117
  this.renderedChunkInfo = null;
17105
17118
  this.renderedDependencies = null;
17106
17119
  this.renderedModules = Object.create(null);
@@ -17175,7 +17188,7 @@ class Chunk {
17175
17188
  }
17176
17189
  return true;
17177
17190
  }
17178
- finalizeChunk(code, map, hashesByPlaceholder) {
17191
+ finalizeChunk(code, map, sourcemapFileName, hashesByPlaceholder) {
17179
17192
  const renderedChunkInfo = this.getRenderedChunkInfo();
17180
17193
  const finalize = (code) => replacePlaceholders(code, hashesByPlaceholder);
17181
17194
  const preliminaryFileName = renderedChunkInfo.fileName;
@@ -17193,7 +17206,8 @@ class Chunk {
17193
17206
  imports: renderedChunkInfo.imports.map(finalize),
17194
17207
  map,
17195
17208
  preliminaryFileName,
17196
- referencedFiles: renderedChunkInfo.referencedFiles.map(finalize)
17209
+ referencedFiles: renderedChunkInfo.referencedFiles.map(finalize),
17210
+ sourcemapFileName
17197
17211
  };
17198
17212
  }
17199
17213
  generateExports() {
@@ -17334,6 +17348,30 @@ class Chunk {
17334
17348
  // Caching is essential to not conflict with the file name reservation above
17335
17349
  return (this.preliminaryFileName = { fileName, hashPlaceholder });
17336
17350
  }
17351
+ getPreliminarySourcemapFileName() {
17352
+ if (this.preliminarySourcemapFileName) {
17353
+ return this.preliminarySourcemapFileName;
17354
+ }
17355
+ let sourcemapFileName = null;
17356
+ let hashPlaceholder = null;
17357
+ const { sourcemapFileNames, format } = this.outputOptions;
17358
+ if (sourcemapFileNames) {
17359
+ const [pattern, patternName] = [sourcemapFileNames, 'output.sourcemapFileNames'];
17360
+ sourcemapFileName = renderNamePattern(typeof pattern === 'function' ? pattern(this.getPreRenderedChunkInfo()) : pattern, patternName, {
17361
+ chunkhash: () => this.getPreliminaryFileName().hashPlaceholder || '',
17362
+ format: () => format,
17363
+ hash: size => hashPlaceholder || (hashPlaceholder = this.getPlaceholder(patternName, size)),
17364
+ name: () => this.getChunkName()
17365
+ });
17366
+ if (!hashPlaceholder) {
17367
+ sourcemapFileName = makeUnique(sourcemapFileName, this.bundle);
17368
+ }
17369
+ }
17370
+ else {
17371
+ return null;
17372
+ }
17373
+ return (this.preliminarySourcemapFileName = { fileName: sourcemapFileName, hashPlaceholder });
17374
+ }
17337
17375
  getRenderedChunkInfo() {
17338
17376
  if (this.renderedChunkInfo) {
17339
17377
  return this.renderedChunkInfo;
@@ -17376,6 +17414,7 @@ class Chunk {
17376
17414
  }
17377
17415
  }
17378
17416
  const preliminaryFileName = this.getPreliminaryFileName();
17417
+ const preliminarySourcemapFileName = this.getPreliminarySourcemapFileName();
17379
17418
  const { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait } = this.renderModules(preliminaryFileName.fileName);
17380
17419
  const renderedDependencies = [...this.getRenderedDependencies().values()];
17381
17420
  const renderedExports = exportMode === 'none' ? [] : this.getChunkExportDeclarations(format);
@@ -17429,6 +17468,7 @@ class Chunk {
17429
17468
  chunk: this,
17430
17469
  magicString,
17431
17470
  preliminaryFileName,
17471
+ preliminarySourcemapFileName,
17432
17472
  usedModules
17433
17473
  };
17434
17474
  }
@@ -19002,8 +19042,8 @@ async function renderChunks(chunks, bundle, pluginDriver, outputOptions, log) {
19002
19042
  timeEnd('render chunks', 2);
19003
19043
  timeStart('transform chunks', 2);
19004
19044
  const chunkGraph = getChunkGraph(chunks);
19005
- const { nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder, hashDependenciesByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, log);
19006
- const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, bundle);
19045
+ const { initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder, hashDependenciesByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, log);
19046
+ const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle);
19007
19047
  addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, outputOptions);
19008
19048
  timeEnd('transform chunks', 2);
19009
19049
  }
@@ -19087,18 +19127,20 @@ async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGrap
19087
19127
  const nonHashedChunksWithPlaceholders = [];
19088
19128
  const renderedChunksByPlaceholder = new Map();
19089
19129
  const hashDependenciesByPlaceholder = new Map();
19130
+ const initialHashesByPlaceholder = new Map();
19090
19131
  const placeholders = new Set();
19091
19132
  for (const { preliminaryFileName: { hashPlaceholder } } of renderedChunks) {
19092
19133
  if (hashPlaceholder)
19093
19134
  placeholders.add(hashPlaceholder);
19094
19135
  }
19095
- await Promise.all(renderedChunks.map(async ({ chunk, preliminaryFileName: { fileName, hashPlaceholder }, magicString, usedModules }) => {
19136
+ await Promise.all(renderedChunks.map(async ({ chunk, preliminaryFileName: { fileName, hashPlaceholder }, preliminarySourcemapFileName, magicString, usedModules }) => {
19096
19137
  const transformedChunk = {
19097
19138
  chunk,
19098
19139
  fileName,
19140
+ sourcemapFileName: preliminarySourcemapFileName?.fileName ?? null,
19099
19141
  ...(await transformChunk(magicString, fileName, usedModules, chunkGraph, outputOptions, pluginDriver, log))
19100
19142
  };
19101
- const { code } = transformedChunk;
19143
+ const { code, map } = transformedChunk;
19102
19144
  if (hashPlaceholder) {
19103
19145
  // To create a reproducible content-only hash, all placeholders are
19104
19146
  // replaced with the same value before hashing
@@ -19122,15 +19164,23 @@ async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGrap
19122
19164
  else {
19123
19165
  nonHashedChunksWithPlaceholders.push(transformedChunk);
19124
19166
  }
19167
+ const sourcemapHashPlaceholder = preliminarySourcemapFileName?.hashPlaceholder;
19168
+ if (map && sourcemapHashPlaceholder) {
19169
+ initialHashesByPlaceholder.set(preliminarySourcemapFileName.hashPlaceholder, createHash()
19170
+ .update(map.toString())
19171
+ .digest('hex')
19172
+ .slice(0, preliminarySourcemapFileName.hashPlaceholder.length));
19173
+ }
19125
19174
  }));
19126
19175
  return {
19127
19176
  hashDependenciesByPlaceholder,
19177
+ initialHashesByPlaceholder,
19128
19178
  nonHashedChunksWithPlaceholders,
19129
19179
  renderedChunksByPlaceholder
19130
19180
  };
19131
19181
  }
19132
- function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, bundle) {
19133
- const hashesByPlaceholder = new Map();
19182
+ function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle) {
19183
+ const hashesByPlaceholder = new Map(initialHashesByPlaceholder);
19134
19184
  for (const [placeholder, { fileName }] of renderedChunksByPlaceholder) {
19135
19185
  let hash = createHash();
19136
19186
  const hashDependencyPlaceholders = new Set([placeholder]);
@@ -19158,21 +19208,29 @@ function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlac
19158
19208
  return hashesByPlaceholder;
19159
19209
  }
19160
19210
  function addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, options) {
19161
- for (const { chunk, code, fileName, map } of renderedChunksByPlaceholder.values()) {
19211
+ for (const { chunk, code, fileName, sourcemapFileName, map } of renderedChunksByPlaceholder.values()) {
19162
19212
  let updatedCode = replacePlaceholders(code, hashesByPlaceholder);
19163
19213
  const finalFileName = replacePlaceholders(fileName, hashesByPlaceholder);
19214
+ let finalSourcemapFileName = null;
19164
19215
  if (map) {
19216
+ finalSourcemapFileName = sourcemapFileName
19217
+ ? replacePlaceholders(sourcemapFileName, hashesByPlaceholder)
19218
+ : `${finalFileName}.map`;
19165
19219
  map.file = replacePlaceholders(map.file, hashesByPlaceholder);
19166
- updatedCode += emitSourceMapAndGetComment(finalFileName, map, pluginDriver, options);
19220
+ updatedCode += emitSourceMapAndGetComment(finalSourcemapFileName, map, pluginDriver, options);
19167
19221
  }
19168
- bundle[finalFileName] = chunk.finalizeChunk(updatedCode, map, hashesByPlaceholder);
19222
+ bundle[finalFileName] = chunk.finalizeChunk(updatedCode, map, finalSourcemapFileName, hashesByPlaceholder);
19169
19223
  }
19170
- for (const { chunk, code, fileName, map } of nonHashedChunksWithPlaceholders) {
19224
+ for (const { chunk, code, fileName, sourcemapFileName, map } of nonHashedChunksWithPlaceholders) {
19171
19225
  let updatedCode = hashesByPlaceholder.size > 0 ? replacePlaceholders(code, hashesByPlaceholder) : code;
19226
+ let finalSourcemapFileName = null;
19172
19227
  if (map) {
19173
- updatedCode += emitSourceMapAndGetComment(fileName, map, pluginDriver, options);
19228
+ finalSourcemapFileName = sourcemapFileName
19229
+ ? replacePlaceholders(sourcemapFileName, hashesByPlaceholder)
19230
+ : `${fileName}.map`;
19231
+ updatedCode += emitSourceMapAndGetComment(finalSourcemapFileName, map, pluginDriver, options);
19174
19232
  }
19175
- bundle[fileName] = chunk.finalizeChunk(updatedCode, map, hashesByPlaceholder);
19233
+ bundle[fileName] = chunk.finalizeChunk(updatedCode, map, finalSourcemapFileName, hashesByPlaceholder);
19176
19234
  }
19177
19235
  }
19178
19236
  function emitSourceMapAndGetComment(fileName, map, pluginDriver, { sourcemap, sourcemapBaseUrl }) {
@@ -19181,11 +19239,11 @@ function emitSourceMapAndGetComment(fileName, map, pluginDriver, { sourcemap, so
19181
19239
  url = map.toUrl();
19182
19240
  }
19183
19241
  else {
19184
- const sourcemapFileName = `${node_path.basename(fileName)}.map`;
19242
+ const sourcemapFileName = node_path.basename(fileName);
19185
19243
  url = sourcemapBaseUrl
19186
19244
  ? new URL(sourcemapFileName, sourcemapBaseUrl).toString()
19187
19245
  : sourcemapFileName;
19188
- pluginDriver.emitFile({ fileName: `${fileName}.map`, source: map.toString(), type: 'asset' });
19246
+ pluginDriver.emitFile({ fileName, source: map.toString(), type: 'asset' });
19189
19247
  }
19190
19248
  return sourcemap === 'hidden' ? '' : `//# ${SOURCEMAPPING_URL}=${url}\n`;
19191
19249
  }
@@ -26801,6 +26859,7 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
26801
26859
  sourcemapBaseUrl: getSourcemapBaseUrl(config),
26802
26860
  sourcemapExcludeSources: config.sourcemapExcludeSources || false,
26803
26861
  sourcemapFile: config.sourcemapFile,
26862
+ sourcemapFileNames: getSourcemapFileNames(config, unsetOptions),
26804
26863
  sourcemapIgnoreList: typeof config.sourcemapIgnoreList === 'function'
26805
26864
  ? config.sourcemapIgnoreList
26806
26865
  : config.sourcemapIgnoreList === false
@@ -27029,6 +27088,13 @@ const getNamespaceToStringTag = (config, generatedCode, inputOptions) => {
27029
27088
  }
27030
27089
  return generatedCode.symbols || false;
27031
27090
  };
27091
+ const getSourcemapFileNames = (config, unsetOptions) => {
27092
+ const configSourcemapFileNames = config.sourcemapFileNames;
27093
+ if (configSourcemapFileNames == null) {
27094
+ unsetOptions.add('sourcemapFileNames');
27095
+ }
27096
+ return configSourcemapFileNames;
27097
+ };
27032
27098
  const getSourcemapBaseUrl = (config) => {
27033
27099
  const { sourcemapBaseUrl } = config;
27034
27100
  if (sourcemapBaseUrl) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.28.1
4
- Tue, 22 Aug 2023 05:30:38 GMT - commit 1b557cd77cce8560cf073875cf6bc289bbe5f09c
3
+ Rollup.js v3.29.0
4
+ Wed, 06 Sep 2023 05:32:40 GMT - commit 884e6781ed67b1c94232fdf80cfe6b1d8fafb9d5
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": "3.28.1",
3
+ "version": "3.29.0",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -62,30 +62,33 @@
62
62
  "optionalDependencies": {
63
63
  "fsevents": "~2.3.2"
64
64
  },
65
+ "devDependenciesComments": {
66
+ "@rollup/plugin-typescript": "It appears that 11.1.3 breaks sourcemaps"
67
+ },
65
68
  "devDependencies": {
66
- "@codemirror/commands": "^6.2.4",
67
- "@codemirror/lang-javascript": "^6.1.9",
69
+ "@codemirror/commands": "^6.2.5",
70
+ "@codemirror/lang-javascript": "^6.2.1",
68
71
  "@codemirror/language": "^6.9.0",
69
- "@codemirror/search": "^6.5.1",
72
+ "@codemirror/search": "^6.5.2",
70
73
  "@codemirror/state": "^6.2.1",
71
- "@codemirror/view": "^6.16.0",
74
+ "@codemirror/view": "^6.17.0",
72
75
  "@jridgewell/sourcemap-codec": "^1.4.15",
73
76
  "@mermaid-js/mermaid-cli": "^10.3.1",
74
77
  "@rollup/plugin-alias": "^5.0.0",
75
78
  "@rollup/plugin-buble": "^1.0.2",
76
79
  "@rollup/plugin-commonjs": "^25.0.4",
77
80
  "@rollup/plugin-json": "^6.0.0",
78
- "@rollup/plugin-node-resolve": "^15.2.0",
81
+ "@rollup/plugin-node-resolve": "^15.2.1",
79
82
  "@rollup/plugin-replace": "^5.0.2",
80
83
  "@rollup/plugin-terser": "^0.4.3",
81
- "@rollup/plugin-typescript": "^11.1.2",
82
- "@rollup/pluginutils": "^5.0.3",
84
+ "@rollup/plugin-typescript": "11.1.2",
85
+ "@rollup/pluginutils": "^5.0.4",
83
86
  "@types/estree": "1.0.1",
84
87
  "@types/mocha": "^10.0.1",
85
- "@types/node": "~14.18.54",
88
+ "@types/node": "~14.18.56",
86
89
  "@types/yargs-parser": "^21.0.0",
87
- "@typescript-eslint/eslint-plugin": "^6.4.0",
88
- "@typescript-eslint/parser": "^6.4.0",
90
+ "@typescript-eslint/eslint-plugin": "^6.5.0",
91
+ "@typescript-eslint/parser": "^6.5.0",
89
92
  "@vue/eslint-config-prettier": "^8.0.0",
90
93
  "@vue/eslint-config-typescript": "^11.0.3",
91
94
  "acorn": "^8.10.0",
@@ -96,12 +99,12 @@
96
99
  "builtin-modules": "^3.3.0",
97
100
  "chokidar": "^3.5.3",
98
101
  "colorette": "^2.0.20",
99
- "concurrently": "^8.2.0",
102
+ "concurrently": "^8.2.1",
100
103
  "core-js": "^3.32.1",
101
104
  "date-time": "^4.0.0",
102
105
  "es5-shim": "^4.6.7",
103
106
  "es6-shim": "^0.35.8",
104
- "eslint": "^8.47.0",
107
+ "eslint": "^8.48.0",
105
108
  "eslint-config-prettier": "^9.0.0",
106
109
  "eslint-plugin-import": "^2.28.1",
107
110
  "eslint-plugin-prettier": "^5.0.0",
@@ -115,9 +118,9 @@
115
118
  "husky": "^8.0.3",
116
119
  "inquirer": "^9.2.10",
117
120
  "is-reference": "^3.0.1",
118
- "lint-staged": "^14.0.0",
121
+ "lint-staged": "^14.0.1",
119
122
  "locate-character": "^3.0.0",
120
- "magic-string": "^0.30.2",
123
+ "magic-string": "^0.30.3",
121
124
  "mocha": "^10.2.0",
122
125
  "nyc": "^15.1.0",
123
126
  "pinia": "^2.1.6",
@@ -125,7 +128,7 @@
125
128
  "pretty-bytes": "^6.1.1",
126
129
  "pretty-ms": "^8.0.0",
127
130
  "requirejs": "^2.3.6",
128
- "rollup": "^3.28.0",
131
+ "rollup": "^3.28.1",
129
132
  "rollup-plugin-license": "^3.0.1",
130
133
  "rollup-plugin-string": "^3.0.0",
131
134
  "rollup-plugin-thatworks": "^1.0.4",
@@ -137,9 +140,9 @@
137
140
  "systemjs": "^6.14.2",
138
141
  "terser": "^5.19.2",
139
142
  "tslib": "^2.6.2",
140
- "typescript": "^5.1.6",
143
+ "typescript": "^5.2.2",
141
144
  "vite": "^4.4.9",
142
- "vitepress": "^1.0.0-rc.4",
145
+ "vitepress": "^1.0.0-rc.10",
143
146
  "vue": "^3.3.4",
144
147
  "weak-napi": "^2.0.2",
145
148
  "yargs-parser": "^21.1.1"