rollup 2.75.7 → 2.76.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/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.7
4
- Mon, 20 Jun 2022 07:24:02 GMT - commit 057171c2d3bc2092b7f543fc05ead01f12595f12
3
+ Rollup.js v2.76.0
4
+ Fri, 08 Jul 2022 08:35:58 GMT - commit 0eb042740eb41812b9e96e0e7b6ed8aa4cab04a7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.7
4
- Mon, 20 Jun 2022 07:24:02 GMT - commit 057171c2d3bc2092b7f543fc05ead01f12595f12
3
+ Rollup.js v2.76.0
4
+ Fri, 08 Jul 2022 08:35:58 GMT - commit 0eb042740eb41812b9e96e0e7b6ed8aa4cab04a7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -14,7 +14,7 @@ import { createHash as createHash$1 } from 'crypto';
14
14
  import { promises } from 'fs';
15
15
  import { EventEmitter } from 'events';
16
16
 
17
- var version$1 = "2.75.7";
17
+ var version$1 = "2.76.0";
18
18
 
19
19
  var charToInteger = {};
20
20
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -14334,7 +14334,7 @@ function renderChunk({ code, options, outputPluginDriver, renderChunk, sourcemap
14334
14334
 
14335
14335
  function renderNamePattern(pattern, patternName, replacements) {
14336
14336
  if (isPathFragment(pattern))
14337
- return error(errFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths.`));
14337
+ return error(errFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.`));
14338
14338
  return pattern.replace(/\[(\w+)\]/g, (_match, type) => {
14339
14339
  if (!replacements.hasOwnProperty(type)) {
14340
14340
  return error(errFailedValidation(`"[${type}]" is not a valid placeholder in "${patternName}" pattern.`));
@@ -23330,6 +23330,16 @@ function sanitizeFileName(name) {
23330
23330
  return driveLetter + name.substr(driveLetter.length).replace(INVALID_CHAR_REGEX, '_');
23331
23331
  }
23332
23332
 
23333
+ function isValidUrl(url) {
23334
+ try {
23335
+ new URL(url);
23336
+ }
23337
+ catch (_) {
23338
+ return false;
23339
+ }
23340
+ return true;
23341
+ }
23342
+
23333
23343
  function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
23334
23344
  var _a, _b, _c, _d, _e, _f, _g;
23335
23345
  // These are options that may trigger special warnings or behaviour later
@@ -23383,6 +23393,7 @@ function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
23383
23393
  ? id => id
23384
23394
  : sanitizeFileName,
23385
23395
  sourcemap: config.sourcemap || false,
23396
+ sourcemapBaseUrl: getSourcemapBaseUrl(config),
23386
23397
  sourcemapExcludeSources: config.sourcemapExcludeSources || false,
23387
23398
  sourcemapFile: config.sourcemapFile,
23388
23399
  sourcemapPathTransform: config.sourcemapPathTransform,
@@ -23608,6 +23619,15 @@ const getNamespaceToStringTag = (config, generatedCode, inputOptions) => {
23608
23619
  }
23609
23620
  return generatedCode.symbols || false;
23610
23621
  };
23622
+ const getSourcemapBaseUrl = (config) => {
23623
+ const { sourcemapBaseUrl } = config;
23624
+ if (sourcemapBaseUrl) {
23625
+ if (isValidUrl(sourcemapBaseUrl)) {
23626
+ return sourcemapBaseUrl;
23627
+ }
23628
+ return error(errInvalidOption('output.sourcemapBaseUrl', 'outputsourcemapbaseurl', `must be a valid URL, received ${JSON.stringify(sourcemapBaseUrl)}`));
23629
+ }
23630
+ };
23611
23631
 
23612
23632
  function rollup(rawInputOptions) {
23613
23633
  return rollupInternal(rawInputOptions, null);
@@ -23770,7 +23790,11 @@ async function writeOutputFile(outputFile, outputOptions) {
23770
23790
  url = outputFile.map.toUrl();
23771
23791
  }
23772
23792
  else {
23773
- url = `${basename(outputFile.fileName)}.map`;
23793
+ const { sourcemapBaseUrl } = outputOptions;
23794
+ const sourcemapFileName = `${basename(outputFile.fileName)}.map`;
23795
+ url = sourcemapBaseUrl
23796
+ ? new URL(sourcemapFileName, sourcemapBaseUrl).toString()
23797
+ : sourcemapFileName;
23774
23798
  writeSourceMapPromise = promises.writeFile(`${fileName}.map`, outputFile.map.toString());
23775
23799
  }
23776
23800
  if (outputOptions.sourcemap !== 'hidden') {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.7
4
- Mon, 20 Jun 2022 07:24:02 GMT - commit 057171c2d3bc2092b7f543fc05ead01f12595f12
3
+ Rollup.js v2.76.0
4
+ Fri, 08 Jul 2022 08:35:58 GMT - commit 0eb042740eb41812b9e96e0e7b6ed8aa4cab04a7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -162,6 +162,7 @@ function mergeOutputOptions(config, overrides, warn) {
162
162
  preserveModulesRoot: getOption('preserveModulesRoot'),
163
163
  sanitizeFileName: getOption('sanitizeFileName'),
164
164
  sourcemap: getOption('sourcemap'),
165
+ sourcemapBaseUrl: getOption('sourcemapBaseUrl'),
165
166
  sourcemapExcludeSources: getOption('sourcemapExcludeSources'),
166
167
  sourcemapFile: getOption('sourcemapFile'),
167
168
  sourcemapPathTransform: getOption('sourcemapPathTransform'),
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.75.7
4
- Mon, 20 Jun 2022 07:24:02 GMT - commit 057171c2d3bc2092b7f543fc05ead01f12595f12
3
+ Rollup.js v2.76.0
4
+ Fri, 08 Jul 2022 08:35:58 GMT - commit 0eb042740eb41812b9e96e0e7b6ed8aa4cab04a7
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -9,19 +9,19 @@
9
9
  */
10
10
  'use strict';
11
11
 
12
- const loadConfigFile = require('./shared/loadConfigFile.js');
13
12
  require('path');
14
13
  require('process');
15
14
  require('url');
15
+ const loadConfigFile_js = require('./shared/loadConfigFile.js');
16
16
  require('./shared/rollup.js');
17
+ require('./shared/mergeOptions.js');
18
+ require('tty');
17
19
  require('perf_hooks');
18
20
  require('crypto');
19
21
  require('fs');
20
22
  require('events');
21
- require('tty');
22
- require('./shared/mergeOptions.js');
23
23
 
24
24
 
25
25
 
26
- module.exports = loadConfigFile.loadAndParseConfigFile;
26
+ module.exports = loadConfigFile_js.loadAndParseConfigFile;
27
27
  //# sourceMappingURL=loadConfigFile.js.map