rollup 3.0.0-0 → 3.0.0-1

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 v3.0.0-0
4
- Tue, 05 Jul 2022 04:32:12 GMT - commit 7a8316af2262c390e7ed72586cb83add1286dec2
3
+ Rollup.js v3.0.0-1
4
+ Fri, 08 Jul 2022 11:35:32 GMT - commit 48ce34db70ebc2b4c1be38e6b8b02881be90b9f1
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-0
4
- Tue, 05 Jul 2022 04:32:12 GMT - commit 7a8316af2262c390e7ed72586cb83add1286dec2
3
+ Rollup.js v3.0.0-1
4
+ Fri, 08 Jul 2022 11:35:32 GMT - commit 48ce34db70ebc2b4c1be38e6b8b02881be90b9f1
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 = "3.0.0-0";
17
+ var version$1 = "3.0.0-1";
18
18
 
19
19
  var charToInteger = {};
20
20
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -13948,7 +13948,7 @@ const replacePlaceholdersWithDefaultAndGetContainedPlaceholders = (code, placeho
13948
13948
 
13949
13949
  function renderNamePattern(pattern, patternName, replacements) {
13950
13950
  if (isPathFragment(pattern))
13951
- return error(errFailedValidation(`Invalid pattern "${pattern}" for "${patternName}", patterns can be neither absolute nor relative paths.`));
13951
+ 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.`));
13952
13952
  return pattern.replace(/\[(\w+)(:\d+)?]/g, (_match, type, size) => {
13953
13953
  if (!replacements.hasOwnProperty(type) || (size && type !== 'hash')) {
13954
13954
  return error(errFailedValidation(`"[${type}${size || ''}]" is not a valid placeholder in the "${patternName}" pattern.`));
@@ -22679,7 +22679,7 @@ class PluginDriver {
22679
22679
  this.finaliseAssets = this.fileEmitter.finaliseAssets.bind(this.fileEmitter);
22680
22680
  this.setChunkInformation = this.fileEmitter.setChunkInformation.bind(this.fileEmitter);
22681
22681
  this.setOutputBundle = this.fileEmitter.setOutputBundle.bind(this.fileEmitter);
22682
- this.plugins = userPlugins.concat(basePluginDriver ? basePluginDriver.plugins : []);
22682
+ this.plugins = (basePluginDriver ? basePluginDriver.plugins : []).concat(userPlugins);
22683
22683
  const existingPluginNames = new Set();
22684
22684
  this.pluginContexts = new Map(this.plugins.map(plugin => [
22685
22685
  plugin,
@@ -23394,6 +23394,16 @@ function sanitizeFileName(name) {
23394
23394
  return driveLetter + name.substr(driveLetter.length).replace(INVALID_CHAR_REGEX, '_');
23395
23395
  }
23396
23396
 
23397
+ function isValidUrl(url) {
23398
+ try {
23399
+ new URL(url);
23400
+ }
23401
+ catch (_) {
23402
+ return false;
23403
+ }
23404
+ return true;
23405
+ }
23406
+
23397
23407
  function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
23398
23408
  var _a, _b, _c, _d, _e, _f, _g;
23399
23409
  // These are options that may trigger special warnings or behaviour later
@@ -23447,6 +23457,7 @@ function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
23447
23457
  ? id => id
23448
23458
  : sanitizeFileName,
23449
23459
  sourcemap: config.sourcemap || false,
23460
+ sourcemapBaseUrl: getSourcemapBaseUrl(config),
23450
23461
  sourcemapExcludeSources: config.sourcemapExcludeSources || false,
23451
23462
  sourcemapFile: config.sourcemapFile,
23452
23463
  sourcemapPathTransform: config.sourcemapPathTransform,
@@ -23675,6 +23686,15 @@ const getNamespaceToStringTag = (config, generatedCode, inputOptions) => {
23675
23686
  }
23676
23687
  return generatedCode.symbols || false;
23677
23688
  };
23689
+ const getSourcemapBaseUrl = (config) => {
23690
+ const { sourcemapBaseUrl } = config;
23691
+ if (sourcemapBaseUrl) {
23692
+ if (isValidUrl(sourcemapBaseUrl)) {
23693
+ return sourcemapBaseUrl;
23694
+ }
23695
+ return error(errInvalidOption('output.sourcemapBaseUrl', 'outputsourcemapbaseurl', `must be a valid URL, received ${JSON.stringify(sourcemapBaseUrl)}`));
23696
+ }
23697
+ };
23678
23698
 
23679
23699
  function rollup(rawInputOptions) {
23680
23700
  return rollupInternal(rawInputOptions, null);
@@ -23837,7 +23857,11 @@ async function writeOutputFile(outputFile, outputOptions) {
23837
23857
  url = outputFile.map.toUrl();
23838
23858
  }
23839
23859
  else {
23840
- url = `${basename(outputFile.fileName)}.map`;
23860
+ const { sourcemapBaseUrl } = outputOptions;
23861
+ const sourcemapFileName = `${basename(outputFile.fileName)}.map`;
23862
+ url = sourcemapBaseUrl
23863
+ ? new URL(sourcemapFileName, sourcemapBaseUrl).toString()
23864
+ : sourcemapFileName;
23841
23865
  writeSourceMapPromise = promises.writeFile(`${fileName}.map`, outputFile.map.toString());
23842
23866
  }
23843
23867
  if (outputOptions.sourcemap !== 'hidden') {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.0.0-0
4
- Tue, 05 Jul 2022 04:32:12 GMT - commit 7a8316af2262c390e7ed72586cb83add1286dec2
3
+ Rollup.js v3.0.0-1
4
+ Fri, 08 Jul 2022 11:35:32 GMT - commit 48ce34db70ebc2b4c1be38e6b8b02881be90b9f1
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 v3.0.0-0
4
- Tue, 05 Jul 2022 04:32:12 GMT - commit 7a8316af2262c390e7ed72586cb83add1286dec2
3
+ Rollup.js v3.0.0-1
4
+ Fri, 08 Jul 2022 11:35:32 GMT - commit 48ce34db70ebc2b4c1be38e6b8b02881be90b9f1
5
5
 
6
6
  https://github.com/rollup/rollup
7
7